1 | {
|
2 |
|
3 | // == Style Options ===================================================
|
4 |
|
5 | "indent" : 2, // Specify indentation spacing
|
6 | "maxerr" : 100, // Maximum errors before stopping.
|
7 | "maxlen" : 80,
|
8 | "quotmark" : "double", // Forces double quotes for strings
|
9 | "predef" : [ // Extra globals.
|
10 | // RequireJS
|
11 | "define",
|
12 | "require",
|
13 | "requirejs",
|
14 |
|
15 | // Test
|
16 | "mocha",
|
17 | "chai",
|
18 | "sinon",
|
19 |
|
20 | "expect",
|
21 | "describe",
|
22 | "it",
|
23 | "before",
|
24 | "beforeEach",
|
25 | "after",
|
26 | "afterEach"
|
27 | ],
|
28 |
|
29 | // == Enforcing Options ===============================================
|
30 |
|
31 | // Turn on:
|
32 | "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
|
33 | "camelcase" : true, // Force all variable names to use either camelCase style or UPPER_CASE with underscores.
|
34 | "curly" : true, // Require {} for every new block or scope.
|
35 | "eqeqeq" : true, // Require triple equals i.e. `===`.
|
36 | "forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`.
|
37 | "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
38 | "latedef" : true, // Prohibit variable use before definition.
|
39 | "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
40 | "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
41 | "noempty" : true, // Prohibit use of empty blocks.
|
42 | "nonew" : true, // Prohibit use of constructors for side-effects.
|
43 | "undef" : true, // Require all non-global variables be declared before they are used.
|
44 | "unused" : true, // Prohibit defined and never used variables.
|
45 | "trailing" : true, // Prohibit trailing whitespaces.
|
46 | // "maxdepth" : 2, // Set level of nesting allowed for the application
|
47 | // "maxstatements" : 0, // Set the max number of statements allowed per function
|
48 | // "maxcomplexity" : 4, // Set the limit for cyclomatic complexity throughout your code
|
49 |
|
50 | // Turn off:
|
51 | "plusplus" : false, // Prohibit use of `++` & `--`.
|
52 | "strict" : false, // Require `use strict` pragma in every file.
|
53 | "maxparams" : 0, // Set the max number of formal parameters allowed per function
|
54 |
|
55 | // == Relaxing Options ================================================
|
56 |
|
57 | // Turn on (relax):
|
58 | "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
59 | "globalstrict" : true, // Allow global "use strict" (also enables 'strict').
|
60 |
|
61 | // Turn off (enforce):
|
62 | "expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
63 | "multistr" : false, // Tolerate multi-line strings.
|
64 | "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
65 | "debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
66 | "eqnull" : false, // Tolerate use of `== null`.
|
67 | "es5" : false, // Allow EcmaScript 5 syntax.
|
68 | "esnext" : false, // Allow ES.next specific features such as `const` and `let`.
|
69 | "evil" : false, // Tolerate use of `eval`.
|
70 | "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
|
71 | "iterator" : false, // Allow usage of __iterator__ property.
|
72 | "lastsemic" : false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
|
73 | "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
74 | "laxcomma" : false, // Suppress warnings about comma-first coding style.
|
75 | "loopfunc" : false, // Allow functions to be defined within loops.
|
76 | "onecase" : false, // Tolerate switches with just one case.
|
77 | "proto" : false, // Tolerate __proto__ property. This property is deprecated.
|
78 | "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
79 | "scripturl" : false, // Tolerate script-targeted URLs.
|
80 | "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
|
81 | "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
82 | "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
83 | "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
84 | "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function.
|
85 |
|
86 | // == Environments ====================================================
|
87 | //
|
88 | // These options pre-define global variables that are exposed by
|
89 | // popular JavaScript libraries and runtime environments—such as
|
90 | // browser or node.js.
|
91 |
|
92 | // Turn on:
|
93 | "browser" : true, // Standard browser globals e.g. `window`, `document`.
|
94 |
|
95 | // Turn off:
|
96 | "couch" : false, // Enable globals exposed by CouchDB.
|
97 | "devel" : false, // Allow development statements e.g. `console.log();`. As a general rule, we should not check in code with console.* statements. Use /*jshint devel:true*/ to override.
|
98 | "dojo" : false, // Enable globals exposed by Dojo Toolkit.
|
99 | "jquery" : false, // Enable globals exposed by jQuery JavaScript library.
|
100 | "mootools" : false, // Enable globals exposed by MooTools JavaScript framework.
|
101 | "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment.
|
102 | "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape.
|
103 | "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework.
|
104 | "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment.
|
105 | "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host.
|
106 |
|
107 | // == JSLint Legacy ===================================================
|
108 | //
|
109 | // These options are legacy from JSLint. Aside from bug fixes they will
|
110 | // not be improved in any way and might be removed at any point.
|
111 |
|
112 | "nomen" : false, // Prohibit use of initial or trailing underbars in names.
|
113 | "onevar" : false, // Allow only one `var` statement per function.
|
114 | "passfail" : false, // Stop on first error.
|
115 | "white" : true // Check against strict whitespace and indentation rules.
|
116 | } |
\ | No newline at end of file |