Giter VIP home page Giter VIP logo

Comments (10)

iam4x avatar iam4x commented on June 15, 2024

Nice catch @postcasio !

from linter.

iam4x avatar iam4x commented on June 15, 2024

@park9140 Do you have time to look into this issue? Or I can do it :)

from linter.

park9140 avatar park9140 commented on June 15, 2024

@postcasio, @iam4x, this is a bug in the jshint linter implementation and or in jshint itself. Unlike other editors that report tabs as single character in width jshint consistantly seems to report that a tab is in fact 4 characters. This shifts the reported positions. After a bit of investigation I can't seem to find a way to prevent jshint from doing this.

It is going to be decently complicated to adjust the positioning properly in the jshint linter. I have reported the issue to jshint, jshint/jshint#1714

from linter.

park9140 avatar park9140 commented on June 15, 2024

Spoke to soon. Found a work around. In your .jshintrc set indent: 1. This will cause jshint to assume that your tab width is 1 and then report the columns correctly.

from linter.

park9140 avatar park9140 commented on June 15, 2024

Reading further it looks like version 2.5 change log calls this out explicitly as the new functionality.

https://github.com/jshint/jshint/releases/tag/2.5.0

So... we should probably just write this off as the known fix when you are using tabs and not spaces.

That release basically makes jshint useless to me in daily usage. We should get a javascript style linter built to restore the style linting they just gutted out of jshint.

from linter.

florianb avatar florianb commented on June 15, 2024

👍 nice findings!

from linter.

postcasio avatar postcasio commented on June 15, 2024

Thanks for your help @park9140, adding indent: 1 works great.

from linter.

iam4x avatar iam4x commented on June 15, 2024

@park9140 Nice finds! I use jscs as code style linter for JavaScript.

from linter.

park9140 avatar park9140 commented on June 15, 2024

Seems like there really isn't anything we can do about this with the current state of jshint. I'm going to close this.

Workaround is to just add 'indent: 1' to your jshint rules.

If anyone determines this doesn't work or they add a method to set this configuration from command line re-open and we can work from there.

from linter.

ricardograca avatar ricardograca commented on June 15, 2024

Can anyone add this note about indent: 1 to the documentation? I had to dig through the issues to find this info.

from linter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.