Last Updated: February 25, 2016
·
3.117K
· nicolas-briemant

Use jshint with node.js

This little article aims to show how to easily use jshint with node.js.

(assuming you are in a node project)


  • Add jshint module to your package.json (preferably in devDependencies)

  • Run npm install jshint

  • Create a .jshintrc file which will contain your specific configuration:

{
    "strict": true
,   "laxcomma": true
}
  • Run ./node_modules/.bin/jshint <paths>
    If you are awesome, you may have a Makefile in which you can add a lint task:
lint:
    ./node_modules/.bin/jshint ./lib ./test ./index.js

and running make lint will do the job perfectly.