-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
69 lines (56 loc) · 2.36 KB
/
.eslintrc.json
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
// LICENSE
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
// distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// END LICENSE
// https://eslint.org/docs/user-guide/configuring
{
"root": true,
"ignorePatterns": ["local/"],
"extends": "eslint:recommended",
// https://eslint.org/docs/rules/
"rules": {
"no-mixed-spaces-and-tabs": "error",
"no-shadow-restricted-names": "error",
"no-ex-assign": "error",
"no-prototype-builtins": "error",
"no-extra-semi": "error",
"getter-return": "error",
"quotes": ["error", "double"],
// Implicit globals are very confusing for TypeScript
"no-implicit-globals": "warn",
// Possibly should be allowed, at least for unused parameters?
"no-unused-vars": ["warn", { "args": "none" }],
"no-redeclare": "warn",
"no-debugger": "warn",
"indent": ["warn", "tab", { "SwitchCase": 1 }],
"no-empty": "warn",
"no-cond-assign": "warn",
// things like if (false), used often to disable code while retaining syntax highlighting, etc.
"no-constant-condition": "off",
// disallows references to undefined variables; currently would break everything with $context/$exports/$loader, so turning
// off
"no-undef": "off",
// Restricts comparison of typeof(x) to other typeofs or correct string literals (and optionally other variables).
// Would break E4X-aware code, so leaving off
"valid-typeof": "off",
// Disallows 'with' statements, currently used by loader
"no-with": "off",
// Below are recommended options needing evaluation, possibly by flagging all instances and examining to see why they're
// being broken
// Disallows escape sequences in strings, RegExp, template literals
"no-useless-escape": "off",
// Disallows unreachable code
"no-unreachable": "off",
// Disallows cast to Boolean in if / while / do-while / for
"no-extra-boolean-cast": "off",
// Disallows assigning value to itself
"no-self-assign": "off",
// Disallows assigning global variables
"no-global-assign": "off",
// TODO why is this needed?
// VSCode error with latest eslint complaining about the definition for the below rule not being found, so disabling it
// for now, since we are not using the optional chain operator anyway (it is not supported by several supported runtimes).
"no-unsafe-optional-chaining": "off"
}
}