Domanda

At the moment we are using JSLint and JSHint. I have tremendous respect for Crockford and his way of using Javascript tightly. We are programming in the flattened style and have a lot of functions. Occasionally cyclical definitions occur.

'use strict' is a priority. So we cannot use 'sloppy' or 'undef' options.

Does anyone know of objective advantages JSLint has over JSHint?

This is not a question about subjective preferences. I am looking for tips like:

e.g.

  • 'regexp' warns about . and ^, whereas, JSHint seems to only warn about . (fine most of the time).

  • there is no alternative to 'some_option'

From the number of different options, they seem to be quite similar. However JSLint seems tighter.

È stato utile?

Soluzione

I know your question was about advantages of JSLint, but off the top of my head there are very few. But here's what I've come up with:

Advantages of JSHint:

  • Support for ES6 syntax (keeps up to date with the spec pretty well too)
  • Ability to ignore any warning with the -Wxxx options
  • A much better web interface
  • Much better tooling integration (it's available via npm, well maintained Grunt plugins etc)

Advantages of JSLint:

  • Code format validation (still available in JSHint with the white option but deprecated and could be removed)
  • Enforces the use of a single var statement per context (still available in JSHint with the onevar option but also deprecated, and questionable whether this is an advantage of JSLint or not)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top