-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
75 lines (70 loc) · 1.97 KB
/
.eslintrc.cjs
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
const paddingLineBetweenStatements = [
"error",
{ blankLine: "always", next: "return", prev: "*" },
]
.concat(
[
"multiline-block-like",
"multiline-expression",
"multiline-const",
"const",
"type",
"interface",
"if",
]
.map((item) => [
{ blankLine: "always", next: "*", prev: item },
{ blankLine: "always", next: item, prev: "*" },
])
.flat(),
)
.concat([
{
blankLine: "any",
next: ["singleline-const"],
prev: ["singleline-const"],
},
]);
module.exports = {
env: {
es2021: true,
},
extends: ["prettier", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "prettier", "@stylistic", "perfectionist"],
rules: {
"@stylistic/padding-line-between-statements": paddingLineBetweenStatements,
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-var-requires": "off",
"arrow-body-style": "error",
"eqeqeq": "error",
"no-else-return": "error",
"no-nested-ternary": "error",
"no-shadow": "off",
"no-useless-return": "error",
"object-shorthand": "error",
"operator-assignment": "error",
"perfectionist/sort-classes": "error",
"perfectionist/sort-enums": "error",
"perfectionist/sort-exports": "error",
"perfectionist/sort-interfaces": "error",
"perfectionist/sort-object-types": "error",
"perfectionist/sort-objects": "error",
"perfectionist/sort-union-types": "error",
"prefer-const": "error",
"prefer-destructuring": ["error"],
"prefer-spread": "error",
"prefer-template": "error",
"quote-props": ["error", "consistent-as-needed"],
},
};