-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
oxlint.json
238 lines (238 loc) · 6.88 KB
/
oxlint.json
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["import", "react", "typescript", "unicorn", "promise"],
"categories": {
"correctness": "error",
"perf": "error"
},
"ignorePatterns": [
"**/node_modules",
".yarn",
".github",
".vscode",
".yarnrc.yml",
".docker",
"**/.storybook",
".coverage",
".nx/**",
"target",
"test-results",
"**/dist",
"**/lib",
"**/storybook-static",
"**/web-static",
"**/public",
"**/e2e-dist-*",
"**/static",
"**/*.gen.ts",
"**/*.gql",
"**/*.d.ts",
"tools/cli/src/webpack/error-handler.js",
"packages/backend/native/index.d.ts",
"packages/frontend/native/index.d.ts",
"packages/frontend/native/index.js",
"packages/frontend/graphql/src/graphql/index.ts",
"packages/frontend/graphql/src/schema.ts",
"packages/frontend/apps/android/App/app/build/**",
"blocksuite/tests-legacy/snapshots"
],
"rules": {
"import/named": "allow",
"no-await-in-loop": "allow",
"promise/no-callback-in-promise": "allow",
"typescript/ban-types": "allow",
"array-callback-return": "error",
"constructor-super": "error",
"eqeqeq": ["error", "smart"],
"getter-return": "error",
"for-direction": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-empty-character-class": "error",
"no-self-compare": "error",
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-unused-vars": "error",
"no-ex-assign": "error",
"no-loss-of-precision": "error",
"no-fallthrough": "error",
"no-nonoctal-decimal-escape": "error",
"no-irregular-whitespace": "error",
"no-control-regex": "error",
"no-with": "error",
"no-debugger": "error",
"no-const-assign": "error",
"no-setter-return": "error",
"no-obj-calls": "error",
"no-unsafe-negation": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-this-before-super": "error",
"no-useless-catch": "error",
"no-async-promise-executor": "error",
"no-unreachable": "error",
"no-duplicate-case": "error",
"no-empty-pattern": "error",
"no-unused-labels": "error",
"no-sparse-arrays": "error",
"no-delete-var": "error",
"no-compare-neg-zero": "error",
"no-redeclare": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-var": "error",
"no-self-assign": "error",
"no-inner-declarations": "error",
"no-dupe-else-if": "error",
"no-invalid-regexp": "error",
"no-unsafe-finally": "error",
"no-prototype-builtins": "error",
"no-array-constructor": "error",
"no-shadow-restricted-names": "error",
"no-constant-condition": "error",
"no-useless-escape": "error",
"no-unsafe-optional-chaining": "error",
"no-extra-boolean-cast": "error",
"no-regex-spaces": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-no-undef": "error",
"react/no-direct-mutation-state": "error",
"react/no-string-refs": "error",
"react/no-unknown-property": "error",
"react/no-danger-with-children": "error",
"react/no-unescaped-entities": "error",
"react/require-render-return": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-key": "error",
"react/no-is-mounted": "error",
"react/no-find-dom-node": "error",
"react/no-children-prop": "error",
"react/no-render-return-value": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-comment-textnodes": "error",
"typescript/consistent-type-imports": "error",
"typescript/no-non-null-assertion": "error",
"typescript/triple-slash-reference": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/prefer-for-of": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-this-alias": [
"error",
{
"allowDestructuring": true
}
],
"typescript/prefer-as-const": "error",
"typescript/no-var-requires": "error",
"typescript/no-namespace": [
"error",
{
"allowDeclarations": true
}
],
"typescript/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false
}
],
"unicorn/prefer-array-some": "error",
"unicorn/no-useless-promise-resolve-reject": "error",
"unicorn/no-unnecessary-await": "error",
"unicorn/no-useless-fallback-in-spread": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
],
"unicorn/prefer-dom-node-dataset": "error",
"unicorn/prefer-dom-node-append": "error",
"unicorn/prefer-dom-node-remove": "error",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-blob-reading-methods": "error",
"unicorn/no-typeof-undefined": "error",
"unicorn/no-new-array": "error",
"unicorn/new-for-builtins": "error",
"unicorn/prefer-node-protocol": "error",
"import/no-cycle": [
"error",
{
"ignoreTypes": true
}
],
"import/sort-imports": "error",
"import/namespace": "off",
"import/no-webpack-loader-syntax": "error",
"import/no-duplicates": "error",
"import/no-import-assign": "error",
"import/no-self-import": "error"
},
"overrides": [
{
"files": ["*.stories.tsx"],
"rules": {
"react/no-array-index-key": "off"
}
},
{
"files": ["packages/backend/**/*.ts"],
"rules": {
"typescript/consistent-type-imports": "off"
}
},
{
"files": [
"*.{spec,test,e2e,stories}.{ts,tsx}",
"tests/**/*.ts",
"packages/backend/server/tests/**/*.ts",
"tools/**.*"
],
"rules": {
"typescript/no-non-null-assertion": "off",
"typescript/ban-ts-comment": [
"error",
{
"ts-expect-error": false,
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false
}
]
}
},
{
"files": ["blocksuite/**/*.ts"],
"rules": {
"eslint/eqeqeq": "off",
"typescript/no-non-null-assertion": "off",
"unicorn/prefer-array-some": "off"
}
},
{
"files": ["blocksuite/tests-legacy/**/*.ts"],
"rules": {
"typescript/ban-ts-comment": "off",
"unicorn/prefer-dom-node-dataset": "off",
"typescript/consistent-type-imports": "off",
"no-cycle": "off"
}
}
]
}