Skip to content

Instantly share code, notes, and snippets.

@jrraymond
Last active February 5, 2017 04:10
Show Gist options
  • Save jrraymond/8342678 to your computer and use it in GitHub Desktop.
Save jrraymond/8342678 to your computer and use it in GitHub Desktop.
A starter JSHint jshintrc file with all options from the [JSHint Options Reference](http://www.jshint.com/docs/options/) list. Just copy into home/project folder and customize.
{
//Enforcing options
"bitwise" : true, // no bitwise operators
"camelcase" : true, // variable names camelCase or UPPER_CASE
"curly" : true, // curly braces around blocks
"eqeqeq" : true, // no == and !=
"es3" : false, // ECMAScript 3 specification
"forin" : true, // for in loops must filter object's items
"freeze" : false, // prevent overwriting native objects
"immed" : true, // immediate function invocations must be wrapped in ()
"indent" : 2, // enforces specific tab width
"latedef" : true, // prohibits use of variable before it is defined
"newcap" : true, // constructor functions capitalized
"noarg" : true, // prohibits arguments.caller and arguments.callee
"noempty" : false, // warns about empty blocks
"nonew" : true, // constructors can't have side effects
"plusplus" : false, // no ++ and --
"quotmark" : true, // enforces consistency of quotation marks (true, single, double
"undef" : true, // prohibits use of explicitly undeclared variables
"unused" : true, // warns when defined variables are never used
"strict" : true, // ECMAScript 5 strict mode
"trailing" : true, // no trailing whitespace
"maxparams" : 1000, // max number of parameters allowed per function
"maxdepth" : 1000, // controls how nested blocks can be
"maxstatements" : 1000, // max number of statements per function
"maxcomplexity" : 1000, // cyclomatic complexity
"maxlen" : 100, // max length of a line
//Relaxing options
"asi" : false, // missing ;
"boss" : false, // assignments when comparisons are expected
"debug" : true, // debugger statements
"eqnull" : false, // == null comparisons
"esnext" : false, // ECMAScript 6 syntax
"evil" : false, // eval
"expr" : false, // expressions where assignment or function calls expected
"funcscope" : false, // functions vs block scope
"gcl" : false, // compatible with Google Closure Compiler
"globalstrict" : false, // suppresses warning about global strict mode
"iterator" : false, // __iterator__ property
"lastsemic" : false, // missing semicolons
"laxbreak" : false, // possible unsafe line breaks
"laxcomma" : false, // comma first coding style
"loopfunc" : true, // defining functions inside of loops
"maxerr" : 1000, // max amount of warnings JSHint will reproduce before giving up
"moz" : false, // using mozilla js extensions
"multistr" : false, // multiline strings
"notypeof" : false, // invalid typeof operator values
"proto" : false, // __proto__ property
"scripturl" : false, // script-targeted URLS
"smarttabs" : false, // mixed tabs and whitespaces
"shadow" : false, // variable shadowing
"sub" : false, // [] instead of .
"supernew" : false, // wierd constructions
"validthis" : false, // strict mode use of this in non consctructors
//Environment
"browser" : true, // defines globals exposed by modern browsers
"couch" : false, // defines globals exposed by CouchDB
"devel" : true, // defines globals for debugging
"dojo" : false, // Dojo Toolkit
"jquery" : true, // JQuery library
"mootools" : false, // MooTools framework
"node" : false, // Node runtime environment
"nonstandard" : false, // nonstandard widely accepted globals
"phantom" : false, // PhantomJS runtime environment
"prototypejs" : false, // Prototype framework
"rhino" : false, // Rhino runtime environment
"worker" : false, // Web Worker
"wsh" : false, // Windows Script Host
"yui" : false, // YUI framework
//Custom globals
"predef" : [
],
//Legacy
"nomen" : false, // disallows dangling _ in variables
"onevar" : false, // only one var per function
"passfail" : false, // jshint stop at first error
"white" : false // checks against Crockfords style
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment