-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
.eslintrc.js
159 lines (159 loc) · 4.6 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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: ["./tsconfig.json"],
},
plugins: [
"@typescript-eslint",
"babel",
"import",
"jsdoc",
"prefer-arrow",
"simple-import-sort",
],
rules: {
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true },
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit",
overrides: {
accessors: "explicit",
constructors: "off",
parameterProperties: "explicit",
},
},
],
"@typescript-eslint/member-ordering": [
"error",
{
default: [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
],
},
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: "variable",
format: ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"],
leadingUnderscore: "allow",
},
{ selector: "typeLike", format: ["PascalCase"] },
{ selector: "enumMember", format: ["PascalCase"] },
],
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/quotes": ["error", "single", { avoidEscape: true }],
"arrow-body-style": ["error", "as-needed"],
"babel/no-invalid-this": "error",
"constructor-super": "error",
curly: ["error", "multi-line"],
eqeqeq: "error",
"import/no-duplicates": "error",
"jsdoc/check-alignment": "error",
"new-parens": "error",
"no-caller": "error",
"no-cond-assign": ["error", "always"],
"no-debugger": "error",
"no-duplicate-case": "error",
"no-else-return": "error",
"no-empty": "error",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-param-reassign": "error",
"no-restricted-globals": [
"error",
"length",
"name",
{
name: "isFinite",
message: "Use the more strict Number.isFinite.",
},
{
name: "isNaN",
message: "Use the more strict Number.isNaN.",
},
],
"no-restricted-properties": [
"error",
{
property: "bind",
message: "Native? Use an arrow function. jQuery? Use .on()",
},
],
"no-return-await": "error",
"no-self-compare": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-sequences": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-unsafe-finally": "error",
"no-var": "error",
"no-with": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"prefer-arrow/prefer-arrow-functions": "error",
"prefer-const": ["error", { destructuring: "all" }],
"prefer-object-spread": "error",
"prefer-rest-params": "error",
radix: "error",
"simple-import-sort/sort": [
"error",
{
groups: [
// Side effect imports (e.g. `import 'foo';`)
["^\\u0000"],
// Third-party code
[
"^(@susisu/mte-kernel,obsidian)(/.*|$)",
],
// Our intra-package imports
["(?<!\\.scss)$"],
],
},
],
"spaced-comment": [
"error",
"always",
{
line: { markers: ["#region", "#endregion"] },
block: { balanced: true },
},
],
"use-isnan": "error",
"linebreak-style": ["error", "unix"],
},
};