Skip to content

Commit 842409d

Browse files
committed
Add .jshintrc.
1 parent c2f11e0 commit 842409d

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.jshintrc

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

0 commit comments

Comments
 (0)