Skip to content

Instantly share code, notes, and snippets.

@mpriour
Last active November 2, 2016 15:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpriour/5901903 to your computer and use it in GitHub Desktop.
Save mpriour/5901903 to your computer and use it in GitHub Desktop.
JSHint Options for esri JSAPI development
{
// --------------------------------------------------------------------
// JSHint Configuration, esri jsapi
// only including options which differ from the standard default
// jshint [options][1] or those in the SublimeText [jshint plugin][2].
// When those 2 default references differ, the option is explictly included
//
// [1]: https://github.com/jshint/jshint/blob/2.x/examples/.jshintrc
// [2]: https://github.com/uipoet/sublime-jshint/blob/master/.jshintrc
// --------------------------------------------------------------------
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
// useful when your codebase is shared with a big number of developers
// with different skill levels.
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef" : true, // Prohibit variable use before definition.
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
"nonew" : true, // Prohibit use of constructors for side-effects.
"unused" : "vars", // Prohibit declaration of unused variables. Ignores function parameters.
"quotmark" : true, // Require a consistent quote type through the file.
"trailing" : false, // Prohibit trailing whitespace when true
"indent" : 2, // {int} Number of spaces to use for indentation
// == Relaxing Options ================================================
//
// These options allow you to suppress certain types of warnings. Use
// them only if you are absolutely positive that you know what you are
// doing.
"funcscope" : true, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
"loopfunc" : true, // Allow functions to be defined within loops.
// == Environments ====================================================
//
// These options pre-define global variables that are exposed by
// popular JavaScript libraries and runtime environments—such as
// browser or node.js.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"devel" : true, // Allow development statements e.g. `console.log();`.
"node" : false, // node.js standard globals
// Legacy
"white" : false, // true: Check against strict whitespace and indentation rules
// == Other Options ============================================
"maxerr" : 1000, // Maximum errors before stopping.
"predef" : [ // Extra globals.
"define",
"require"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment