-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
144 lines (144 loc) · 3.82 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
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
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
es6: true,
jasmine: true,
jest: true,
jquery: false,
node: true,
},
extends: ["plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 13,
sourceType: "module",
},
plugins: ["@typescript-eslint", "sort-destructure-keys", "sort-exports"],
root: true,
rules: {
"@typescript-eslint/indent": [
"error",
"tab",
{
SwitchCase: 1,
ignoredNodes: [
"TSUnionType",
"ArrowFunctionExpression > BlockStatement",
"NoSubstitutionTemplateLiteral",
"TemplateLiteral",
/* "TSTypeAliasDeclaration *", */
"TSTypeParameterInstantiation",
],
},
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "semi",
requireLast: true,
},
singleline: {
delimiter: "semi",
requireLast: true,
},
},
],
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"array-bracket-spacing": ["error", "never"],
"arrow-parens": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", { after: true, before: false }],
"key-spacing": ["error", { afterColon: true, beforeColon: false }],
"keyword-spacing": ["error", { after: true, before: true }],
"max-len": [
"error",
{
code: 180,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
ignoreUrls: true,
tabWidth: 2,
},
],
"new-cap": ["error", { properties: false }],
"no-console": ["warn"],
// "no-mixed-spaces-and-tabs": ["warn"],
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 0 }],
"no-tabs": ["error", { allowIndentationTabs: true }],
"no-unused-vars": ["off"],
"no-var": ["error"],
"object-curly-newline": [
"error",
{
ExportDeclaration: { minProperties: 3, multiline: true },
ImportDeclaration: { minProperties: 3, multiline: true },
ObjectExpression: { consistent: true, multiline: true },
ObjectPattern: { consistent: true, multiline: true },
},
],
"object-curly-spacing": ["error", "always", { objectsInObjects: true }],
"object-property-newline": [
"error",
{ allowAllPropertiesOnSameLine: true },
],
"object-shorthand": ["error", "always"],
"operator-linebreak": ["error", "before"],
"padded-blocks": ["error", { blocks: "never" }],
"padding-line-between-statements": [
"error",
{ blankLine: "always", next: "*", prev: "directive" },
{ blankLine: "any", next: "directive", prev: "directive" },
{ blankLine: "always", next: "*", prev: ["const", "let", "var"] },
{
blankLine: "any",
next: ["const", "let", "var"],
prev: ["const", "let", "var"],
},
{ blankLine: "always", next: "return", prev: "*" },
{ blankLine: "any", next: "*", prev: ["case", "default"] },
],
"quote-props": ["error", "as-needed"],
quotes: ["warn", "double"],
"require-atomic-updates": 0,
semi: ["error", "always"],
"semi-spacing": [2, { after: true, before: false }],
"sort-destructure-keys/sort-destructure-keys": [2, { caseSensitive: true }],
"sort-imports": [
"error",
{
allowSeparatedGroups: true,
ignoreCase: false,
ignoreDeclarationSort: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
},
],
"space-before-blocks": [
"error",
{
classes: "always",
functions: "always",
keywords: "always",
},
],
"space-before-function-paren": [
"warn",
{
anonymous: "never",
asyncArrow: "always",
named: "never",
},
],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
},
};