-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
186 lines (185 loc) · 5.04 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
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
// eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module
const path = require("node:path");
// eslint-disable-next-line unicorn/prefer-module
module.exports = {
root: true,
env: {
browser: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended",
"plugin:unicorn/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
ecmaFeatures: {
modules: true,
},
},
plugins: [
"@typescript-eslint",
"prettier",
"sonarjs",
"sort-imports-es6-autofix",
"unicorn",
"unused-imports",
],
rules: {
"unicorn/no-null": "off",
"unicorn/prefer-top-level-await": "off",
"no-undef": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true },
],
camelcase: ["error", { properties: "never", ignoreDestructuring: true }],
"prettier/prettier": "error",
"sort-imports-es6-autofix/sort-imports-es6": [
"error",
{
ignoreCase: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
},
],
"no-template-curly-in-string": "error",
"require-atomic-updates": "error",
curly: ["error", "all"],
"dot-notation": "error",
eqeqeq: "error",
"no-alert": "warn",
"no-empty": ["error", { allowEmptyCatch: true }],
"no-empty-function": "off",
"no-empty-pattern": "warn",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-iterator": "error",
"no-lone-blocks": "warn",
"no-loop-func": "error",
"no-multi-str": "error",
"no-new-wrappers": "error",
"no-proto": "error",
"no-restricted-properties": "warn",
"no-return-assign": "error",
"no-return-await": "off",
"no-script-url": "error",
"no-self-compare": "warn",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unused-expressions": "warn",
"no-unused-vars": "off",
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"no-void": "error",
"no-warning-comments": ["off", { location: "anywhere" }],
"no-with": "error",
radix: ["error", "as-needed"],
"require-await": "warn",
yoda: "error",
"consistent-this": "error",
"func-name-matching": "error",
"lines-between-class-members": [
"error",
"always",
{ exceptAfterSingleLine: true },
],
"max-len": [
"error",
{
code: 80,
ignoreComments: true,
ignorePattern: "^import\\s.+\\sfrom\\s.+;$",
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
"new-cap": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",
"no-negated-condition": "error",
"no-nested-ternary": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"one-var": ["error", "never"],
"operator-assignment": "error",
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
"prefer-const": "error",
"prefer-destructuring": ["error", { array: false, object: true }],
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"unicorn/filename-case": [
"error",
{
cases: {
camelCase: true,
pascalCase: true,
},
},
],
"unicorn/prevent-abbreviations": [
"error",
{
replacements: {
ref: false,
prop: false,
props: false,
},
},
],
"unicorn/no-useless-undefined": [
"error",
{
checkArguments: false,
},
],
"sonarjs/cognitive-complexity": ["error", 999],
"sonarjs/no-duplicate-string": "off",
},
overrides: [
{
files: ["*.ts"],
rules: {
// https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034
"@typescript-eslint/no-unused-vars": "warn",
},
},
],
};