Skip to content

Instantly share code, notes, and snippets.

@anthonyshort
Created October 12, 2012 05:03
Show Gist options
  • Save anthonyshort/3877422 to your computer and use it in GitHub Desktop.
Save anthonyshort/3877422 to your computer and use it in GitHub Desktop.
JSHint Options
jshint: {
// See http://www.jshint.com/docs/
options: {
// Enforce camelcase variables
camelcase: true,
// Always put curly braces around blocks in loops and conditionals
curly: true,
// This options prohibits the use of == and != in favor of === and !==
eqeqeq: true,
// Enforce 2 space indentation
indent: 2,
// This option prohibits the use of a variable before it was defined
// Prevents variable hoisting
latedef: true,
// capitalize names of constructor functions
newcap: true,
// prohibits the use of arguments.caller and arguments.callee
noarg: true,
// prohibits the use of constructor functions for side-effects
nonew: true,
// prohibits the use of unary increment and decrement operators
plusplus: true,
// prohibits the use of explicitly undeclared variables
undef: true,
// warns when you define and never use your variables
unused: true,
// suppresses warnings about the use of assignments in cases where comparisons are expected
boss: true,
// suppresses warnings about == null. Such comparisons are often useful when you want to check if a variable is null or undefined.
eqnull: true,
// defines globals exposed by modern browsers
browser: true,
// set the max number of formal parameters allowed per function
maxparams: 5,
// control how nested do you want your blocks to be
maxdepth: 5,
// max number of statements allowed per function
maxstatements: 25,
// control cyclomatic complexity throughout your code
maxcomplexity: 10
},
globals: {
Handlebars: false,
console: false,
$: false,
_: false,
Backbone: false,
moment: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment