errors.js
5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
'use strict';
module.exports = {
rules: {
/**
* require trailing commas in multiline object literals
* @see http://eslint.org/docs/rules/comma-dangle
* @see http://blog.hotoo.me/post/trailing-commas
*/
'comma-dangle': [ 'error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
/**
* @see http://eslint.org/docs/rules/no-cond-assign
* @example
*
* ```js
* // Incorrect
* function setHeight(someNode) {
* do {
* someNode.height = '100px';
* } while (someNode = someNode.parentNode);
* }
*
* // correct
* function setHeight(someNode) {
* do {
* someNode.height = '100px';
* } while ((someNode = someNode.parentNode));
* }
* ```
*/
'no-cond-assign': [ 'error', 'except-parens' ],
/**
* This rule warns the usage of `console`
* @see http://eslint.org/docs/rules/no-console
*/
'no-console': 'off',
/**
* disallow use of constant expressions in conditions
* @see http://eslint.org/docs/rules/no-constant-condition
*/
'no-constant-condition': 'error',
/**
* disallow control characters in regular expressions
* @see http://eslint.org/docs/rules/no-control-regex
*/
'no-control-regex': 'error',
/**
* disallow use of debugger
* @see http://eslint.org/docs/rules/no-debugger
*/
'no-debugger': 'error',
/**
* disallow duplicate arguments in functions
* @see http://eslint.org/docs/rules/no-dupe-args
*/
'no-dupe-args': 'error',
/**
* disallow duplicate keys when creating object literals
* @see http://eslint.org/docs/rules/no-dupe-keys
*/
'no-dupe-keys': 'error',
/**
* disallow a duplicate case label.
* @see http://eslint.org/docs/rules/no-duplicate-case
*/
'no-duplicate-case': 'error',
/**
* disallow empty statements
* @see http://eslint.org/docs/rules/no-empty
*/
'no-empty': 'error',
/**
* disallow the use of empty character classes in regular expressions
* @see http://eslint.org/docs/rules/no-empty-character-class
*/
'no-empty-character-class': 'error',
/**
* disallow assigning to the exception in a catch block
* @see http://eslint.org/docs/rules/no-ex-assign
*/
'no-ex-assign': 'error',
/**
* disallow double-negation boolean casts in a boolean context
* @see http://eslint.org/docs/rules/no-extra-boolean-cast
*/
'no-extra-boolean-cast': 'error',
/**
* disallow unnecessary parentheses
*
* @example
*
* // allow
* module.export = app => (
* // some js docs
* class Test extends app.Proxy {
*
* }
* );
*
* @see http://eslint.org/docs/rules/no-extra-parens
*/
'no-extra-parens': [ 'error', 'functions' ],
/**
* disallow unnecessary semicolons
* @see http://eslint.org/docs/rules/no-extra-semi
*/
'no-extra-semi': 'error',
/**
* disallow overwriting functions written as function declarations
* @see http://eslint.org/docs/rules/no-func-assign
*/
'no-func-assign': 'error',
/**
* disallow function declarations in nested blocks
* @see http://eslint.org/docs/rules/no-inner-declarations
*/
'no-inner-declarations': [ 'error', 'functions' ],
/**
* disallow invalid regular expression strings in the RegExp constructor
* @see http://eslint.org/docs/rules/no-invalid-regexp
*/
'no-invalid-regexp': 'error',
/**
* disallow irregular whitespace outside of strings and comments
* @see http://eslint.org/docs/rules/no-irregular-whitespace
*/
'no-irregular-whitespace': 'error',
/**
* disallow negation of the left operand of an in expression
* @see http://eslint.org/docs/rules/no-negated-in-lhs
*/
'no-negated-in-lhs': 'error',
/**
* disallow the use of object properties of the global object (Math and JSON) as functions
* @see http://eslint.org/docs/rules/no-obj-calls
*/
'no-obj-calls': 'error',
/**
* disallow multiple spaces in a regular expression literal
* @see http://eslint.org/docs/rules/no-regex-spaces
*/
'no-regex-spaces': 'error',
/**
* disallow sparse arrays
* @see http://eslint.org/docs/rules/no-sparse-arrays
*/
'no-sparse-arrays': 'error',
/**
* Avoid code that looks like two expressions but is actually one
* @see http://eslint.org/docs/rules/no-unexpected-multiline
*/
'no-unexpected-multiline': 'off',
/**
* disallow unreachable statements after a return, throw, continue, or break statement
* @see http://eslint.org/docs/rules/no-unreachable
*/
'no-unreachable': 'error',
/**
* disallow return/throw/break/continue inside finally blocks
* @see http://eslint.org/docs/rules/no-unsafe-finally
*/
'no-unsafe-finally': 'error',
/**
* disallow comparisons with the value NaN
* @see http://eslint.org/docs/rules/use-isnan
*/
'use-isnan': 'error',
/**
* This rule has deprecated https://eslint.org/blog/2018/11/jsdoc-end-of-life
* ensure JSDoc comments are valid
* @see http://eslint.org/docs/rules/valid-jsdoc
*/
'valid-jsdoc': 'off',
/**
* Doesn't enforce comparing typeof expressions against valid strings
* @see http://eslint.org/docs/rules/valid-typeof
*/
'valid-typeof': 'off',
},
};