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.
Written by Nicolas Briemant
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#