-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
315 lines (304 loc) · 23 KB
/
.eslintrc
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
{
"globals": {},
"plugins": [],
"reportUnusedDisableDirectives": true,
"env":{
"browser": true, // browser global variables.
"node": true, // Node.js global variables and Node.js scoping.
"commonjs": false, // CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).
"shared-node-browser": false, // Globals common to both Node.js and Browser.
"es6": true, // enable all ECMAScript 6 features except for modules (this automatically sets the ecmaVersion parser option to 6).
"es2017": false, // adds all ECMAScript 2017 globals and automatically sets the ecmaVersion parser option to 8.
"es2020": false, // adds all ECMAScript 2020 globals and automatically sets the ecmaVersion parser option to 11.
"es2021": false, // adds all ECMAScript 2021 globals and automatically sets the ecmaVersion parser option to 12.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
"jest": false, // Jest global variables.
"phantomjs": false, // PhantomJS global variables.
"protractor": false, // Protractor global variables.
"qunit": false, // QUnit global variables.
"jquery": false, // jQuery global variables.
"prototypejs": false, // Prototype.js global variables.
"shelljs": false, // ShellJS global variables.
"meteor": false, // Meteor global variables.
"mongo": false, // MongoDB global variables.
"applescript": false, // AppleScript global variables.
"nashorn": false, // Java 8 Nashorn global variables.
"serviceworker": false, // Service Worker global variables.
"atomtest": false, // Atom test helper globals.
"embertest": false, // Ember test helper globals.
"webextensions": false, // WebExtensions globals.
"greasemonkey": false, // GreaseMonkey globals.
},
"rules": {
/// Possible Errors
"for-direction": 1, // enforce "for" loop update clause moving the counter in the right direction.
"getter-return": 1, // enforce `return` statements in getters
"no-async-promise-executor": 0, // disallow using an async function as a Promise executor
"no-await-in-loop": 1, // disallow `await` inside of loops
"no-compare-neg-zero": 1, // disallow comparing against -0
"no-cond-assign": 1, // disallow assignment operators in conditional expressions
"no-console": 0, // disallow the use of `console`
"no-constant-condition": 1, // disallow constant expressions in conditions
"no-control-regex": 1, // disallow control characters in regular expressions
"no-debugger": 1, // disallow the use of `debugger`
"no-dupe-args": 1, // disallow duplicate arguments in `function` definitions
"no-dupe-else-if": 0, // disallow duplicate conditions in if-else-if chains
"no-dupe-keys": 1, // disallow duplicate keys in object literals
"no-duplicate-case": 1, // disallow duplicate case labels
"no-empty": 1, // disallow empty block statements
"no-empty-character-class": 1, // disallow empty character classes in regular expressions
"no-ex-assign": 1, // disallow reassigning exceptions in `catch` clauses
"no-extra-boolean-cast": 1, // disallow unnecessary boolean casts
"no-extra-parens": 1, // disallow unnecessary parentheses
"no-extra-semi": 0, // disallow unnecessary semicolons
"no-func-assign": 1, // disallow reassigning `function` declarations
"no-import-assign": 0, // disallow assigning to imported bindings
"no-inner-declarations": 1, // disallow variable or `function` declarations in nested blocks
"no-invalid-regexp": 1, // disallow invalid regular expression strings in `RegExp` constructors
"no-irregular-whitespace": 1, // disallow irregular whitespace
"no-loss-of-precision": 0, // disallow literal numbers that lose precision
"no-misleading-character-class": 0, // disallow characters which are made with multiple code points in character class syntax
"no-obj-calls": 1, // disallow calling global object properties as functions
"no-promise-executor-return": 0, // disallow returning values from Promise executor functions
"no-prototype-builtins": 1, // disallow calling some `Object.prototype` methods directly on objects
"no-regex-spaces": 1, // disallow multiple spaces in regular expressions
"no-setter-return": 0, // disallow returning values from setters
"no-sparse-arrays": 1, // disallow sparse arrays
"no-template-curly-in-string": 1, // disallow template literal placeholder syntax in regular strings
"no-unexpected-multiline": 1, // disallow confusing multiline expressions
"no-unreachable": 1, // disallow unreachable code after `return`, `throw`, `continue`, and `break` statements
"no-unreachable-loop": 0, // disallow loops with a body that allows only one iteration
"no-unsafe-finally": 1, // disallow control flow statements in `finally` blocks
"no-unsafe-negation": 1, // disallow negating the left operand of relational operators
"no-unsafe-optional-chaining": 0, // disallow use of optional chaining in contexts where the `undefined` value is not allowed
"no-useless-backreference": 0, // disallow useless backreferences in regular expressions
"require-atomic-updates": 0, // disallow assignments that can lead to race conditions due to usage of `await` or `yield`
"use-isnan": 1, // require calls to `isNaN()` when checking for `NaN`
"valid-typeof": 1, // enforce comparing `typeof` expressions against valid strings
/// Best Practices
"accessor-pairs": 1, // enforce getter and setter pairs in objects and classes
"array-callback-return": 1, // enforce `return` statements in callbacks of array methods
"block-scoped-var": 1, // enforce the use of variables within the scope they are defined
"class-methods-use-this": 1, // enforce that class methods utilize `this`
"complexity": 1, // enforce a maximum cyclomatic complexity allowed in a program
"consistent-return": 1, // require `return` statements to either always or never specify values
"curly": 1, // enforce consistent brace style for all control statements
"default-case": 1, // require `default` cases in `switch` statements
"default-case-last": 0, // enforce default clauses in switch statements to be last
"default-param-last": 0, // enforce default parameters to be last
"dot-location": 0, // enforce consistent newlines before and after dots
"dot-notation": 1, // enforce dot notation whenever possible
"eqeqeq": 1, // require the use of `===` and `!==`
"grouped-accessor-pairs": 0, // require grouped accessor pairs in object literals and classes
"guard-for-in": 1, // require `for-in` loops to include an `if` statement
"max-classes-per-file": 0, // enforce a maximum number of classes per file
"no-alert": 1, // disallow the use of `alert`, `confirm`, and `prompt`
"no-caller": 1, // disallow the use of `arguments.caller` or `arguments.callee`
"no-case-declarations": 1, // disallow lexical declarations in case clauses
"no-constructor-return": 0, // disallow returning value from constructor
"no-div-regex": 1, // disallow division operators explicitly at the beginning of regular expressions
"no-else-return": 1, // disallow `else` blocks after `return` statements in `if` statements
"no-empty-function": 1, // disallow empty functions
"no-empty-pattern": 1, // disallow empty destructuring patterns
"no-eq-null": 1, // disallow `null` comparisons without type-checking operators
"no-eval": 1, // disallow the use of `eval()`
"no-extend-native": 1, // disallow extending native types
"no-extra-bind": 1, // disallow unnecessary calls to `.bind()`
"no-extra-label": 1, // disallow unnecessary labels
"no-fallthrough": 1, // disallow fallthrough of `case` statements
"no-floating-decimal": 1, // disallow leading or trailing decimal points in numeric literals
"no-global-assign": 1, // disallow assignments to native objects or read-only global variables
"no-implicit-coercion": 1, // disallow shorthand type conversions
"no-implicit-globals": 0, // disallow declarations in the global scope
"no-implied-eval": 1, // disallow the use of `eval()`-like methods
"no-invalid-this": 1, // disallow `this` keywords outside of classes or class-like objects
"no-iterator": 1, // disallow the use of the `__iterator__` property
"no-labels": 1, // disallow labeled statements
"no-lone-blocks": 1, // disallow unnecessary nested blocks
"no-loop-func": 1, // disallow function declarations that contain unsafe references inside loop statements
"no-magic-numbers": 0, // disallow magic numbers
"no-multi-spaces": 1, // disallow multiple spaces
"no-multi-str": 1, // disallow multiline strings
"no-new": 1, // disallow `new` operators outside of assignments or comparisons
"no-new-func": 1, // disallow `new` operators with the `Function` object
"no-new-wrappers": 1, // disallow `new` operators with the `String`, `Number`, and `Boolean` objects
"no-nonoctal-decimal-escape": 0, // disallow `\8` and `\9` escape sequences in string literals
"no-octal": 1, // disallow octal literals
"no-octal-escape": 1, // disallow octal escape sequences in string literals
"no-param-reassign": 1, // disallow reassigning `function` parameters
"no-proto": 1, // disallow the use of the `__proto__` property
"no-redeclare": 1, // disallow variable redeclaration
"no-restricted-properties": 1, // disallow certain properties on certain objects
"no-return-assign": 1, // disallow assignment operators in `return` statements
"no-return-await": 1, // disallow unnecessary `return await`
"no-script-url": 1, // disallow `javascript:` urls
"no-self-assign": 1, // disallow assignments where both sides are exactly the same
"no-self-compare": 1, // disallow comparisons where both sides are exactly the same
"no-sequences": 1, // disallow comma operators
"no-throw-literal": 1, // disallow throwing literals as exceptions
"no-unmodified-loop-condition": 1, // disallow unmodified loop conditions
"no-unused-expressions": 1, // disallow unused expressions
"no-unused-labels": 1, // disallow unused labels
"no-useless-call": 1, // disallow unnecessary calls to `.call()` and `.apply()`
"no-useless-catch": 0, // disallow unnecessary `catch` clauses
"no-useless-concat": 1, // disallow unnecessary concatenation of literals or template literals
"no-useless-escape": 1, // disallow unnecessary escape characters
"no-useless-return": 1, // disallow redundant return statements
"no-void": 1, // disallow `void` operators
"no-warning-comments": 1, // disallow specified warning terms in comments
"no-with": 1, // disallow `with` statements
"prefer-named-capture-group": 0, // enforce using named capture group in regular expression
"prefer-promise-reject-errors": 1, // require using Error objects as Promise rejection reasons
"prefer-regex-literals": 0, // disallow use of the `RegExp` constructor in favor of regular expression literals
"radix": 1, // enforce the consistent use of the radix argument when using `parseInt()`
"require-await": 1, // disallow async functions which have no `await` expression
"require-unicode-regexp": 0, // enforce the use of `u` flag on RegExp
"vars-on-top": 1, // require `var` declarations be placed at the top of their containing scope
"wrap-iife": 1, // require parentheses around immediate `function` invocations
"yoda": 1, // require or disallow "Yoda" conditions
/// Strict Mode
"strict": 0, // require or disallow strict mode directives
/// Variables
"init-declarations": 1, // require or disallow initialization in variable declarations
"no-delete-var": 1, // disallow deleting variables
"no-label-var": 1, // disallow labels that share a name with a variable
"no-restricted-globals": 1, // disallow specified global variables
"no-shadow": 1, // disallow variable declarations from shadowing variables declared in the outer scope
"no-shadow-restricted-names": 1, // disallow identifiers from shadowing restricted names
"no-undef": 1, // disallow the use of undeclared variables unless mentioned in `/*global */` comments
"no-undef-init": 1, // disallow initializing variables to `undefined`
"no-undefined": 0, // disallow the use of `undefined` as an identifier
"no-unused-vars": 1, // disallow unused variables
"no-use-before-define": 1, // disallow the use of variables before they are defined
/// Stylistic Issues
"array-bracket-newline": 1, // enforce linebreaks after opening and before closing array brackets
"array-bracket-spacing": 1, // enforce consistent spacing inside array brackets
"array-element-newline": 0, // enforce line breaks after each array element
"block-spacing": 1, // disallow or enforce spaces inside of blocks after opening block and before closing block
"brace-style": 1, // enforce consistent brace style for blocks
"camelcase": 0, // enforce camelcase naming convention
"capitalized-comments": 0, // enforce or disallow capitalization of the first letter of a comment
"comma-dangle": 0, // require or disallow trailing commas
"comma-spacing": 1, // enforce consistent spacing before and after commas
"comma-style": 1, // enforce consistent comma style
"computed-property-spacing": 1, // enforce consistent spacing inside computed property brackets
"consistent-this": 1, // enforce consistent naming when capturing the current execution context
"eol-last": 1, // require or disallow newline at the end of files
"func-call-spacing": 1, // require or disallow spacing between function identifiers and their invocations
"func-name-matching": 1, // require function names to match the name of the variable or property to which they are assigned
"func-names": 1, // require or disallow named `function` expressions
"func-style": 0, // enforce the consistent use of either `function` declarations or expressions
"function-call-argument-newline": 0, // enforce line breaks between arguments of a function call
"function-paren-newline": 0, // enforce consistent line breaks inside function parentheses
"id-denylist": 1, // disallow specified identifiers
"id-length": 1, // enforce minimum and maximum identifier lengths
"id-match": 1, // require identifiers to match a specified regular expression
"implicit-arrow-linebreak": 0, // enforce the location of arrow function bodies
"indent": 0, // enforce consistent indentation
"jsx-quotes": 1, // enforce the consistent use of either double or single quotes in JSX attributes
"key-spacing": 1, // enforce consistent spacing between keys and values in object literal properties
"keyword-spacing": 1, // enforce consistent spacing before and after keywords
"line-comment-position": 1, // enforce position of line comments
"linebreak-style": 1, // enforce consistent linebreak style
"lines-around-comment": 1, // require empty lines around comments
"lines-between-class-members": 0, // require or disallow an empty line between class members
"max-depth": 0, // enforce a maximum depth that blocks can be nested
"max-len": 0, // enforce a maximum line length
"max-lines": 0, // enforce a maximum number of lines per file
"max-lines-per-function": 0, // enforce a maximum number of lines of code in a function
"max-nested-callbacks": 1, // enforce a maximum depth that callbacks can be nested
"max-params": 0, // enforce a maximum number of parameters in function definitions
"max-statements": 0, // enforce a maximum number of statements allowed in function blocks
"max-statements-per-line": 1, // enforce a maximum number of statements allowed per line
"multiline-comment-style": 0, // enforce a particular style for multiline comments
"multiline-ternary": 1, // enforce newlines between operands of ternary expressions
"new-cap": 1, // require constructor names to begin with a capital letter
"new-parens": 1, // enforce or disallow parentheses when invoking a constructor with no arguments
"newline-per-chained-call": 1, // require a newline after each call in a method chain
"no-array-constructor": 1, // disallow `Array` constructors
"no-bitwise": 0, // disallow bitwise operators
"no-continue": 1, // disallow `continue` statements
"no-inline-comments": 1, // disallow inline comments after code
"no-lonely-if": 1, // disallow `if` statements as the only statement in `else` blocks
"no-mixed-operators": 1, // disallow mixed binary operators
"no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation
"no-multi-assign": 1, // disallow use of chained assignment expressions
"no-multiple-empty-lines": 1, // disallow multiple empty lines
"no-negated-condition": 1, // disallow negated conditions
"no-nested-ternary": 1, // disallow nested ternary expressions
"no-new-object": 1, // disallow `Object` constructors
"no-plusplus": 0, // disallow the unary operators `++` and `--`
"no-restricted-syntax": 1, // disallow specified syntax
"no-tabs": 1, // disallow all tabs
"no-ternary": 1, // disallow ternary operators
"no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
"no-underscore-dangle": 1, // disallow dangling underscores in identifiers
"no-unneeded-ternary": 1, // disallow ternary operators when simpler alternatives exist
"no-whitespace-before-property": 1, // disallow whitespace before properties
"nonblock-statement-body-position": 1, // enforce the location of single-line statements
"object-curly-newline": 0, // enforce consistent line breaks after opening and before closing braces
"object-curly-spacing": 0, // enforce consistent spacing inside braces
"object-property-newline": 0, // enforce placing object properties on separate lines
"one-var": 0, // enforce variables to be declared either together or separately in functions
"one-var-declaration-per-line": 1, // require or disallow newlines around variable declarations
"operator-assignment": 1, // require or disallow assignment operator shorthand where possible
"operator-linebreak": 1, // enforce consistent linebreak style for operators
"padded-blocks": 0, // require or disallow padding within blocks
"padding-line-between-statements": 1, // require or disallow padding lines between statements
"prefer-exponentiation-operator": 0, // disallow the use of `Math.pow` in favor of the `**` operator
"prefer-object-spread": 0, // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.
"quote-props": 0, // require quotes around object literal property names
"quotes": 0, // enforce the consistent use of either backticks, double, or single quotes
"semi": 1, // require or disallow semicolons instead of ASI
"semi-spacing": 1, // enforce consistent spacing before and after semicolons
"semi-style": 1, // enforce location of semicolons
"sort-keys": 1, // require object keys to be sorted
"sort-vars": 1, // require variables within the same declaration block to be sorted
"space-before-blocks": 1, // enforce consistent spacing before blocks
"space-before-function-paren": 0, // enforce consistent spacing before `function` definition opening parenthesis
"space-in-parens": 1, // enforce consistent spacing inside parentheses
"space-infix-ops": 0, // require spacing around infix operators
"space-unary-ops": 1, // enforce consistent spacing before or after unary operators
"spaced-comment": 1, // enforce consistent spacing after the `//` or `/*` in a comment
"switch-colon-spacing": 1, // enforce spacing around colons of switch statements
"template-tag-spacing": 1, // require or disallow spacing between template tags and their literals
"unicode-bom": 1, // require or disallow Unicode byte order mark (BOM)
"wrap-regex": 1, // require parenthesis around regex literals
/// ECMAScript 6
"arrow-body-style": 1, // require braces around arrow function bodies
"arrow-parens": 1, // require parentheses around arrow function arguments
"arrow-spacing": 1, // enforce consistent spacing before and after the arrow in arrow functions
"constructor-super": 1, // require `super()` calls in constructors
"generator-star-spacing": 1, // enforce consistent spacing around `*` operators in generator functions
"no-class-assign": 1, // disallow reassigning class members
"no-confusing-arrow": 1, // disallow arrow functions where they could be confused with comparisons
"no-const-assign": 1, // disallow reassigning `const` variables
"no-dupe-class-members": 1, // disallow duplicate class members
"no-duplicate-imports": 1, // disallow duplicate module imports
"no-new-symbol": 1, // disallow `new` operators with the `Symbol` object
"no-restricted-exports": 0, // disallow specified names in exports
"no-restricted-imports": 1, // disallow specified modules when loaded by `import`
"no-this-before-super": 1, // disallow `this`/`super` before calling `super()` in constructors
"no-useless-computed-key": 1, // disallow unnecessary computed property keys in objects and classes
"no-useless-constructor": 1, // disallow unnecessary constructors
"no-useless-rename": 1, // disallow renaming import, export, and destructured assignments to the same name
"no-var": 1, // require `let` or `const` instead of `var`
"object-shorthand": 1, // require or disallow method and property shorthand syntax for object literals
"prefer-arrow-callback": 1, // require using arrow functions for callbacks
"prefer-const": 0, // require `const` declarations for variables that are never reassigned after declared
"prefer-destructuring": 1, // require destructuring from arrays and/or objects
"prefer-numeric-literals": 1, // disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
"prefer-rest-params": 1, // require rest parameters instead of `arguments`
"prefer-spread": 1, // require spread operators instead of `.apply()`
"prefer-template": 1, // require template literals instead of string concatenation
"require-yield": 1, // require generator functions to contain `yield`
"rest-spread-spacing": 1, // enforce spacing between rest and spread operators and their expressions
"sort-imports": 1, // enforce sorted import declarations within modules
"symbol-description": 1, // require symbol descriptions
"template-curly-spacing": 1, // require or disallow spacing around embedded expressions of template strings
"yield-star-spacing": 1, // require or disallow spacing around the `*` in `yield*` expressions
}
}