1 | module.exports = {
|
2 | 'rules': {
|
3 | // enforces getter/setter pairs in objects
|
4 | 'accessor-pairs': 0,
|
5 | // enforces return statements in callbacks of array's methods
|
6 | // http://eslint.org/docs/rules/array-callback-return
|
7 | 'array-callback-return': 2,
|
8 | // treat var statements as if they were block scoped
|
9 | 'block-scoped-var': 2,
|
10 | // specify the maximum cyclomatic complexity allowed in a program
|
11 | 'complexity': [0, 11],
|
12 | // require return statements to either always or never specify values
|
13 | 'consistent-return': 2,
|
14 | // specify curly brace conventions for all control statements
|
15 | 'curly': [2, 'multi-line'],
|
16 | // require default case in switch statements
|
17 | 'default-case': [2, { 'commentPattern': '^no default$' }],
|
18 | // encourages use of dot notation whenever possible
|
19 | 'dot-notation': [2, { 'allowKeywords': true }],
|
20 | // enforces consistent newlines before or after dots
|
21 | 'dot-location': 0,
|
22 | // require the use of === and !==
|
23 | // http://eslint.org/docs/rules/eqeqeq
|
24 | 'eqeqeq': [2, 'allow-null'],
|
25 | // make sure for-in loops have an if statement
|
26 | 'guard-for-in': 2,
|
27 | // Blacklist certain identifiers to prevent them being used
|
28 | // http://eslint.org/docs/rules/id-blacklist
|
29 | 'id-blacklist': 0,
|
30 | // disallow the use of alert, confirm, and prompt
|
31 | 'no-alert': 1,
|
32 | // disallow use of arguments.caller or arguments.callee
|
33 | 'no-caller': 2,
|
34 | // disallow lexical declarations in case/default clauses
|
35 | // http://eslint.org/docs/rules/no-case-declarations.html
|
36 | 'no-case-declarations': 2,
|
37 | // disallow division operators explicitly at beginning of regular expression
|
38 | 'no-div-regex': 0,
|
39 | // disallow else after a return in an if
|
40 | 'no-else-return': 2,
|
41 | // disallow empty functions, except for standalone funcs/arrows
|
42 | // http://eslint.org/docs/rules/no-empty-function
|
43 | 'no-empty-function': [2, {
|
44 | 'allow': [
|
45 | 'arrowFunctions',
|
46 | 'functions',
|
47 | 'methods',
|
48 | ]
|
49 | }],
|
50 | // disallow empty destructuring patterns
|
51 | // http://eslint.org/docs/rules/no-empty-pattern
|
52 | 'no-empty-pattern': 2,
|
53 | // disallow Unnecessary Labels
|
54 | // http://eslint.org/docs/rules/no-extra-label
|
55 | 'no-extra-label': 2,
|
56 | // disallow comparisons to null without a type-checking operator
|
57 | 'no-eq-null': 0,
|
58 | // disallow use of eval()
|
59 | 'no-eval': 2,
|
60 | // disallow adding to native types
|
61 | 'no-extend-native': 2,
|
62 | // disallow unnecessary function binding
|
63 | 'no-extra-bind': 2,
|
64 | // disallow fallthrough of case statements
|
65 | 'no-fallthrough': 2,
|
66 | // disallow the use of leading or trailing decimal points in numeric literals
|
67 | 'no-floating-decimal': 2,
|
68 | // disallow the type conversions with shorter notations
|
69 | 'no-implicit-coercion': 0,
|
70 | // disallow use of eval()-like methods
|
71 | 'no-implied-eval': 2,
|
72 | // disallow this keywords outside of classes or class-like objects
|
73 | 'no-invalid-this': 0,
|
74 | // disallow usage of __iterator__ property
|
75 | 'no-iterator': 2,
|
76 | // disallow use of labels for anything other then loops and switches
|
77 | 'no-labels': [2, { 'allowLoop': false, 'allowSwitch': false }],
|
78 | // disallow unnecessary nested blocks
|
79 | 'no-lone-blocks': 2,
|
80 | // disallow creation of functions within loops
|
81 | 'no-loop-func': 2,
|
82 | // disallow magic numbers
|
83 | // http://eslint.org/docs/rules/no-magic-numbers
|
84 | 'no-magic-numbers': [0, {
|
85 | 'ignore': [],
|
86 | 'ignoreArrayIndexes': true,
|
87 | 'enforceConst': true,
|
88 | 'detectObjects': false,
|
89 | }],
|
90 | // disallow use of multiple spaces
|
91 | 'no-multi-spaces': 2,
|
92 | // disallow use of multiline strings
|
93 | 'no-multi-str': 2,
|
94 | // disallow reassignments of native objects
|
95 | 'no-native-reassign': 2,
|
96 | // disallow use of new operator when not part of the assignment or comparison
|
97 | 'no-new': 2,
|
98 | // disallow use of new operator for Function object
|
99 | 'no-new-func': 2,
|
100 | // disallows creating new instances of String, Number, and Boolean
|
101 | 'no-new-wrappers': 2,
|
102 | // disallow use of (old style) octal literals
|
103 | 'no-octal': 2,
|
104 | // disallow use of octal escape sequences in string literals, such as
|
105 | // var foo = 'Copyright \251';
|
106 | 'no-octal-escape': 2,
|
107 | // disallow reassignment of function parameters
|
108 | // disallow parameter object manipulation
|
109 | // rule: http://eslint.org/docs/rules/no-param-reassign.html
|
110 | 'no-param-reassign': [2, { 'props': true }],
|
111 | // disallow use of process.env
|
112 | 'no-process-env': 0,
|
113 | // disallow usage of __proto__ property
|
114 | 'no-proto': 2,
|
115 | // disallow declaring the same variable more then once
|
116 | 'no-redeclare': 2,
|
117 | // disallow certain syntax forms
|
118 | // http://eslint.org/docs/rules/no-restricted-syntax
|
119 | 'no-restricted-syntax': [
|
120 | 2,
|
121 | 'DebuggerStatement',
|
122 | 'ForInStatement',
|
123 | 'LabeledStatement',
|
124 | 'WithStatement',
|
125 | ],
|
126 | // disallow use of assignment in return statement
|
127 | 'no-return-assign': 2,
|
128 | // disallow use of `javascript:` urls.
|
129 | 'no-script-url': 2,
|
130 | // disallow comparisons where both sides are exactly the same
|
131 | 'no-self-compare': 2,
|
132 | // disallow use of comma operator
|
133 | 'no-sequences': 2,
|
134 | // restrict what can be thrown as an exception
|
135 | 'no-throw-literal': 2,
|
136 | // disallow unmodified conditions of loops
|
137 | // http://eslint.org/docs/rules/no-unmodified-loop-condition
|
138 | 'no-unmodified-loop-condition': 0,
|
139 | // disallow return/throw/break/continue inside finally blocks
|
140 | // http://eslint.org/docs/rules/no-unsafe-finally
|
141 | 'no-unsafe-finally': 2,
|
142 | // disallow usage of expressions in statement position
|
143 | 'no-unused-expressions': 2,
|
144 | // disallow unused labels
|
145 | // http://eslint.org/docs/rules/no-unused-labels
|
146 | 'no-unused-labels': 2,
|
147 | // disallow unnecessary .call() and .apply()
|
148 | 'no-useless-call': 0,
|
149 | // disallow useless string concatenation
|
150 | // http://eslint.org/docs/rules/no-useless-concat
|
151 | 'no-useless-concat': 2,
|
152 | // disallow unnecessary string escaping
|
153 | // http://eslint.org/docs/rules/no-useless-escape
|
154 | 'no-useless-escape': 2,
|
155 | // disallow use of void operator
|
156 | 'no-void': 0,
|
157 | // disallow usage of configurable warning terms in comments: e.g. todo
|
158 | 'no-warning-comments': [0, { 'terms': ['todo', 'fixme', 'xxx'], 'location': 'start' }],
|
159 | // disallow use of the with statement
|
160 | 'no-with': 2,
|
161 | // require use of the second argument for parseInt()
|
162 | 'radix': 2,
|
163 | // requires to declare all vars on top of their containing scope
|
164 | 'vars-on-top': 2,
|
165 | // require immediate function invocation to be wrapped in parentheses
|
166 | // http://eslint.org/docs/rules/wrap-iife.html
|
167 | 'wrap-iife': [2, 'outside'],
|
168 | // require or disallow Yoda conditions
|
169 | 'yoda': 2
|
170 | }
|
171 | };
|