-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
145 lines (145 loc) · 5.12 KB
/
.eslintrc.js
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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: { project: "./tsconfig.json" },
plugins: ["@typescript-eslint", "prettier", "promise", "security"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:security/recommended",
],
rules: {
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "as" }],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/space-infix-ops": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/typedef": [
"error",
{
arrayDestructuring: true,
arrowParameter: true,
memberVariableDeclaration: true,
objectDestructuring: true,
parameter: true,
propertyDeclaration: true,
variableDeclaration: true,
},
],
"@typescript-eslint/unified-signatures": "error",
"array-callback-return": "error",
"arrow-body-style": ["error", "as-needed"],
"constructor-super": "error",
curly: ["error", "all"],
"max-len": [
"warn",
{
code: 120,
ignorePattern: "^(?!.*/(/|\\*) .* .*).*$",
},
],
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-constant-condition": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-imports": "error",
"no-restricted-globals": "error",
"no-eval": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-irregular-whitespace": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loss-of-precision": "error",
"no-nested-ternary": "error",
"no-plusplus": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unreachable": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-private-class-members": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"object-shorthand": ["error", "always"],
"one-var": ["error", "never"],
"padding-line-between-statements": [
"warn",
{
blankLine: "always",
prev: "*",
next: [
"class",
"do",
"for",
"function",
"if",
"multiline-block-like",
"multiline-const",
"multiline-expression",
"multiline-let",
"multiline-var",
"switch",
"try",
"while",
],
},
{
blankLine: "always",
prev: [
"class",
"do",
"for",
"function",
"if",
"multiline-block-like",
"multiline-const",
"multiline-expression",
"multiline-let",
"multiline-var",
"switch",
"try",
"while",
],
next: "*",
},
{
blankLine: "always",
prev: "*",
next: ["continue", "return"],
},
],
"prefer-template": "error",
"prettier/prettier": "error",
"promise/prefer-await-to-then": "error",
"require-atomic-updates": "error",
"require-await": "warn",
"security/detect-non-literal-fs-filename": "off",
"security/detect-object-injection": "off",
"spaced-comment": ["warn", "always"],
"sort-imports": ["error", { allowSeparatedGroups: true, ignoreCase: true }],
"valid-typeof": "error",
},
};