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 jshintCreate 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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#