Domanda

I understand the reasoning for linting code, I'm not asking why you would use a form of linting.

I've worked on projects where both JSLint and JSHint were used - this is my question, why would you use both for the same code? Surely anything that passes JSLint is going to pass JSHint?

È stato utile?

Soluzione

JSHint can emulate pretty much everything in JSLint, so I can't think of a single good reason.

Check out all of the options that are provided by JSHint:

http://jshint.com/docs/options/

It's possible that that the newest version of JSLint have some special checks that are missing from JSHint, but in general JSHint is more popular (github stars) and moves faster (many commits and contributors), so I'd stick with JSHint.

Or of course, the more flexible ESLint which is quickly becoming the most awesome IMO :)

Another possible reason is that some CI environments may specifically be able to read the JSLint XML format, but of course JSHint can generate that as well, so again it's not a good reason.

The creator of JSHint also started a thread about this on Twitter which may aid your thoughts: https://twitter.com/valueof/status/380119627482660864

The only 2 reasons why people said they still used JSLint was:

Jeremy Dunck ‏@jdunck 17 Sep

@valueof marketing and switching cost.

Jordan Harband ‏@ljharb 17 Sep

@valueof the only reason I don’t is that it no longer supports tab chars. It catches whitespace things jshint doesn't.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top