UNPKG

5.47 kBPlain TextView Raw
1{
2 // JSHint Default Configuration File (as on JSHint website)
3 // See http://jshint.com/docs/ for more details
4
5 "esversion": 6,
6
7 "maxerr" : 50, // {int} Maximum error before stopping
8
9 // Enforcing
10 "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
11 "camelcase" : true, // true: Identifiers must be in camelCase
12 "curly" : true, // true: Require {} for every new block or scope
13 "eqeqeq" : true, // true: Require triple equals (===) for comparison
14 "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
15 "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
16 "indent" : 2, // {int} Number of spaces to use for indentation
17 "latedef" : true, // true: Require variables/functions to be defined before being used
18 "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
19 "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
20 "noempty" : true, // true: Prohibit use of empty blocks
21 "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
22 "plusplus" : true, // true: Prohibit use of `++` & `--`
23 "quotmark" : "single", // Quotation mark consistency:
24 // false : do nothing (default)
25 // true : ensure whatever is used is consistent
26 // "single" : require single quotes
27 // "double" : require double quotes
28 "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
29 "unused" : true, // true: Require all defined variables be used
30 "strict" : true, // true: Requires all functions run in ES5 Strict Mode
31 "trailing" : true, // true: Prohibit trailing whitespaces
32 "maxparams" : false, // {int} Max number of formal params allowed per function
33 "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
34 "maxstatements" : false, // {int} Max number statements per function
35 "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
36 "maxlen" : false, // {int} Max number of characters per line
37
38 // Relaxing
39 "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
40 "boss" : false, // true: Tolerate assignments where comparisons would be expected
41 "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
42 "eqnull" : false, // true: Tolerate use of `== null`
43 //"es5" : true, // true: Allow ES5 syntax (ex: getters and setters)
44 "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
45 // (ex: `for each`, multiple try/catch, function expression…)
46 "evil" : false, // true: Tolerate use of `eval` and `new Function()`
47 "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
48 "funcscope" : false, // true: Tolerate defining variables inside control statements"
49 "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
50 "iterator" : false, // true: Tolerate using the `__iterator__` property
51 "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
52 "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
53 "laxcomma" : false, // true: Tolerate comma-first style coding
54 "loopfunc" : false, // true: Tolerate functions being defined in loops
55 "multistr" : false, // true: Tolerate multi-line strings
56 "proto" : false, // true: Tolerate using the `__proto__` property
57 "scripturl" : false, // true: Tolerate script-targeted URLs
58 "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
59 "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
60 "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
61 "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
62 "validthis" : false, // true: Tolerate using this in a non-constructor function
63
64 // Environments
65 "browser" : false, // Web Browser (window, document, etc)
66 "devel" : false, // Development/debugging (alert, confirm, etc)
67 "mocha" : true, // Mocha
68 "node" : true, // Node.js
69 "nonstandard" : true, // Widely adopted globals (escape, unescape, etc)
70
71 // Legacy
72 "nomen" : false, // true: Prohibit dangling `_` in variables
73 "onevar" : false, // true: Allow only one `var` statement per function
74 "passfail" : false, // true: Stop on first error
75 "white" : true, // true: Check against strict whitespace and indentation rules
76
77 // Custom Globals
78 "predef" : [ // additional predefined global variables
79 ]
80}