O'Reilly logo
  • Ankur Vatsa thinks this is interesting:

Consistent use of a linter will make you a better programmer: I promise that. Given that, wouldn’t it be nice if your linter integrated into your editor and you were informed of potential errors as soon as you made them? Well, you’re in luck. JSHint integrates into many popular editors.


Cover of Web Development with Node and Express


Use ESLint instead: JSHint and JSLint did not work for me
ESLint is here: https://eslint.org/docs/user-guide/getting-started

Local Installation and Usage
If you want to include ESLint as part of your project’s build system, we recommend installing it locally. You can do so using npm:

$ npm install eslint --save-dev
You should then setup a configuration file:

$ ./node_modules/.bin/eslint --init
After that, you can run ESLint in your project’s root directory like this:

$ ./node_modules/.bin/eslint yourfile.js

But, unfortunately I have not been able to make it work with Grunt yet. Will keep trying and update when successful. Until then, be in 1980s and do it all manually.