Skip to content

Instantly share code, notes, and snippets.

@kanchudeep
Last active October 28, 2018 07:48
Show Gist options
  • Save kanchudeep/2e761f223c5591ea8c76648d034fb0ac to your computer and use it in GitHub Desktop.
Save kanchudeep/2e761f223c5591ea8c76648d034fb0ac to your computer and use it in GitHub Desktop.
{
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: <Deprecated> Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"esversion" : 3, // {int}: Specify ECMAScript version to which code must adhere: 3 (old browsers, 5, 6)
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // true: Prohibits overwriting prototypes of native objects such as Array, Date and so on
"funcscope" : false, // true: Suppress warnings about declaring variables inside blocks while accessing later from outside e.g. 'function foo() { var bar = 0; }; bar++;'
"futurehostile" : true, // true: Enables warnings about use of identifiers which are defined in future versions of JavaScript
"globals" : {}, // white list of global variables that are not formally defined in source code e.g. { "foo": true }
"immed" : false, // true: <Deprecated> Require immediate invocations to be wrapped in parens e.g. '(function () { } ());'
"indent" : 2, // {int} <Deprecated> Number of spaces to use for indentation
"iterator" : false, // true: Tolerate using '__iterator__' property
"latedef" : false, // true: Prohibits use of functions/variable before being defined
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxerr" : 256, // {int} Maximum error before stopping
"maxlen" : false, // {int} <Deprecated> Maximum length of a line
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxstatements" : false, // {int} Max number statements per function
"newcap" : true, // true: <Deprecated> Require capitalization of all constructor functions e.g. 'new F()'
"noarg" : true, // true: Prohibit use of 'arguments.caller' and 'arguments.callee'
"nocomma" : true, // true: Prohibits use of comma operator
"noempty" : true, // true: <Deprecated> Prohibit use of empty blocks
"nonbsp" : true, // true: Warns about "non-breaking whitespace" characters (can break non-UTF8 pages)
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"notypeof" : false, // true: Suppress warnings about invalid typeof operator values
"predef" : [], // [{string}]: Variables to be considered as implicitly defined in environment, prefix name with a '-' to remove
"quotmark" : true, // <Deprecated> Quotation mark consistency:
// false: do nothing (default)
// true: ensure whatever is used is consistent
// "single": require single quotes
// "double": require double quotes
"shadow" : false, // Warn about variable shadowing i.e. re-declaring variables later e.g. 'var x=1; var x=2;'
// true: allow variable shadowing
// false: same as inner
// "inner": check for variables defined in same scope only
// "outer": check for variables defined in outer scopes as well
"singleGroups" : false, // true: Prohibits use of grouping operator when not strictly required
"strict" : false, // Requires code to run in ECMAScript 5's strict mode
// true: there must be "use strict"; directive at function level
// false: disable warnings about strict mode
// "global": there must be "use strict"; directive at global level
// "implied": check code as if there is "use strict"; directive
"trailing" : true, // true: Prohibit trailing whitespaces ???
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : "strict", // Warn about defined variable not being used
// true: allow unused parameters followed by used parameter in function e.g.: 'function(a, b) { b++; }' // no warning
// false: disable
// "strict": check all variables and parameters
// "vars": only check variables not functions
"varstmt" : false, // true: Use of 'var' are forbidden (user 'let'/'const')
// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"elision" : false, // true: Code uses ES3 array elision elements
"eqnull" : false, // true: Tolerate use of '== null'
"evil" : false, // true: Tolerate use of 'eval' and 'new Function()'
"expr" : false, // true: Tolerate 'ExpressionStatement' as Programs
"lastsemic" : false, // true: Tolerate omitting a semicolon for last statement of a 1-line block
"laxbreak" : true, // true: <Deprecated> Tolerate possibly unsafe line breakings
"laxcomma" : false, // true: <Deprecated> Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (e.g.: 'for each', multiple try/catch, function expression…)
"multistr" : false, // true: <Deprecated> Tolerate multi-line strings
"noyield" : false, // true: Suppress warnings about generator functions with no yield statement in them
"plusplus" : false, // true: Prohibit use of '++' & '--'
"proto" : false, // true: Tolerate using '__proto__' property
"scripturl" : false, // true: Tolerate script-targeted URLs
"smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment ???
"sub" : false, // true: <Deprecated> Tolerate using '[]' notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate 'new function () { ... };' and 'new Object;'
"validthis" : false, // true: Tolerate using this in a non-constructor function in strict mode
"withstmt" : false, // true: Suppress warnings about use of with statement
// Environments
"browser" : true, // Web Browser (window, document, etc)
"browserify" : false, // Browserify tool
"couch" : false, // CouchDB
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : false, // Jasmine unit testing framework
"jquery" : false, // jQuery
"mocha" : false, // Mocha unit testing framework
"module" : false, // Informs that input code describes an ECMAScript 6 module
"mootools" : false, // MooTools
"node" : false, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit unit testing framework
"rhino" : false, // Rhino
"shelljs" : false, // ShellJS library
"typed" : false, // Define globals for typed array constructors
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface
// Legacy
"nomen" : false, // true: Prohibit dangling '_' in variables
"onevar" : false, // true: Allow only one 'var' statement per function
"passfail" : false, // true: Stop on first error
"white" : false // true: Check against strict whitespace and indentation rules
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment