UNPKG

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