/
.eslintrc.json
98 lines (92 loc) · 3.87 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
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
{
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"allowImportExportEverywhere": true
},
"rules": {
/**
* The following rules fix possible problems. (STRICTLY ENFORCED)
*/
// Disallows use of undeclared variables
"no-undef": "off",
// Disallows await in loop which might slow down processes.
"no-await-in-loop": "error",
// Disallows irregular whitespace outside of strings and comments.
"no-irregular-whitespace": "error",
// Disallows unreachable code after return, throw, continue, and break statements.
"no-unreachable": "error",
// Enforces "for" loop update clause moving the counter in the right direction.
"for-direction": "error",
// Disallows reassigning class members.
"no-class-assign": "error",
// Disallows debugger statements
"no-debugger": "error",
// Disallows control characters in regular expressions.
"no-control-regex": "error",
// Disallows returning values from setters.
"no-return-assign": "error",
// Disallows returning values from constructor functions.
"no-constructor-return": "error",
// Disallows duplicate case labels in switch statements.
"no-duplicate-case": "error",
// Disallows duplicate arguments in functions.
"no-dupe-args": "error",
// Disallows duplicate conditions in if-else-if chains.
"no-dupe-else-if": "error",
// Disallows reassigning const variables.
"no-const-assign": "error",
// Disallow empty destructuring patterns.
"no-empty-pattern": "error",
// Disallow invalid regular expression strings in RegExp constructors.
"no-invalid-regexp": "error",
// Disallow duplicate keys in object literals.
"no-dupe-keys": "error",
/**
* The following rules provide alternative solutions. (OPTIONAL)
*/
// Disallows console logs
"no-console": ["warn", { "allow": ["warn", "error"] }],
// Disallows unused expressions
"no-unused-expressions": "warn",
// Disallows initializing variables to `undefined`
"no-undef-init": "warn",
// Disallows use of undefined variable
"no-undefined": "off",
// Disallow named `function` expressions
"func-names": "warn",
// Require destructuring from arrays and/or objects
"prefer-destructuring": ["warn", { "object": true, "array": false }],
// Disallows the use of with statements and function expressions.
"no-restricted-syntax": ["warn", "WithStatement"],
// Disallows using this/super inside methods.
"object-shorthand": "off",
// Enforces using this/super inside methods.
"class-methods-use-this": "off",
// Disallows comments that are not a multiline comment.
"multiline-comment-style": ["warn", "starred-block"],
// Disallows trailing whitespace at the end of lines.
"no-trailing-spaces": "warn",
/* Disallow duplicate imports.
*
* Using "no-duplicate-imports" from ESLint causes false positive
* errors for type imports.
*/
"@typescript-eslint/no-duplicate-imports": "off",
/* Disallow usage of the `any` type. */
"@typescript-eslint/no-explicit-any": "off",
/* Disallows unused variables.
*
* Using "no-unused-vars" from ESLint causes false positive errors for
* function prototypes in interfaces.
*/
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-types": "off"
}
}