Which is better and why?
Thanks in advance.
jshint.com appears to be an open source copy of jslint.com
So in conclusion jshint is much better.
More specifically, jslint was created by Doug Crockford, and although he's very smart and knowledgeable, he's also very dogmatic, and that's reflected in jslint, which has several of Crockford's coding rules baked into the linter. jshint is a fork of jslint, but made to be more configurable. These days, I think jshint is the better tool.
Those particular rules are there because of the errors that sometimes occur if you don't apply those rules.
Douglas Crockford has been known to modify the script to build in additional rules once it is made clear to him that without the rule that the code is error prone.
In other words he's dogmatic for good reasons and being able to turn off rules where jslint doesn't provide an option for doing so is not necessarily a good thing.
Here's a little bit more on why Anton Kovalyov forked JSLint to JSHint: http://anton.kovalyov.net/2011/02/20/why-i-forked-jslint-to-jshint/
It seems to me that JSLint is generally a little more lenient (or at least configurable or agnostic) on a few stylistic and minor syntactical "opinions" that JSLint (i.e. Mr Crockford) is a stickler on.
JSHint is my preferred linter because of its configurability and tendency to be a little more lenient. In general the things I tell it to be lenient about are not things that would break anything if they were not adhered to (such as indentation/whitespace rules, type of quotes used, etc.)
This topic is now closed. New replies are no longer allowed.