@wondermarin/eslint-config 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/configs/base.json +343 -0
- package/configs/react.json +118 -0
- package/configs/typescript.json +141 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Wondermarin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @wondermarin/eslint-config
|
|
2
|
+
<span>Personal <a href="https://eslint.org">ESLint</a> config.</span>
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
yarn add -D @wondermarin/eslint-config
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
`.eslintrc`:
|
|
13
|
+
```jsonc
|
|
14
|
+
{
|
|
15
|
+
"extends": [
|
|
16
|
+
"@wondermarin/eslint-config", // Base config.
|
|
17
|
+
"@wondermarin/eslint-config/typescript", // TypeScript config.
|
|
18
|
+
"@wondermarin/eslint-config/react" // React & React Hooks config.
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parserOptions": {
|
|
3
|
+
"ecmaVersion": 2023,
|
|
4
|
+
"sourceType": "module"
|
|
5
|
+
},
|
|
6
|
+
"env": {
|
|
7
|
+
"es2023": true
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
"prettier",
|
|
11
|
+
"perfectionist"
|
|
12
|
+
],
|
|
13
|
+
"rules": {
|
|
14
|
+
"array-callback-return": "error",
|
|
15
|
+
"constructor-super": "off",
|
|
16
|
+
"for-direction": "error",
|
|
17
|
+
"getter-return": "off",
|
|
18
|
+
"no-async-promise-executor": "error",
|
|
19
|
+
"no-await-in-loop": "off",
|
|
20
|
+
"no-class-assign": "error",
|
|
21
|
+
"no-compare-neg-zero": "error",
|
|
22
|
+
"no-cond-assign": ["error", "always"],
|
|
23
|
+
"no-const-assign": "off",
|
|
24
|
+
"no-constant-binary-expression": "error",
|
|
25
|
+
"no-constant-condition": "error",
|
|
26
|
+
"no-constructor-return": "error",
|
|
27
|
+
"no-control-regex": "error",
|
|
28
|
+
"no-debugger": "error",
|
|
29
|
+
"no-dupe-args": "off",
|
|
30
|
+
"no-dupe-class-members": "off",
|
|
31
|
+
"no-dupe-else-if": "error",
|
|
32
|
+
"no-dupe-keys": "off",
|
|
33
|
+
"no-duplicate-case": "error",
|
|
34
|
+
"no-duplicate-imports": "error",
|
|
35
|
+
"no-empty-character-class": "error",
|
|
36
|
+
"no-empty-pattern": "error",
|
|
37
|
+
"no-ex-assign": "error",
|
|
38
|
+
"no-fallthrough": "error",
|
|
39
|
+
"no-func-assign": "off",
|
|
40
|
+
"no-import-assign": "off",
|
|
41
|
+
"no-inner-declarations": "error",
|
|
42
|
+
"no-invalid-regexp": "error",
|
|
43
|
+
"no-irregular-whitespace": "error",
|
|
44
|
+
"no-loss-of-precision": "off",
|
|
45
|
+
"no-misleading-character-class": "error",
|
|
46
|
+
"no-new-native-nonconstructor": "error",
|
|
47
|
+
"no-new-symbol": "off",
|
|
48
|
+
"no-obj-calls": "off",
|
|
49
|
+
"no-promise-executor-return": "error",
|
|
50
|
+
"no-prototype-builtins": "error",
|
|
51
|
+
"no-self-assign": "error",
|
|
52
|
+
"no-self-compare": "error",
|
|
53
|
+
"no-setter-return": "off",
|
|
54
|
+
"no-sparse-arrays": "error",
|
|
55
|
+
"no-template-curly-in-string": "error",
|
|
56
|
+
"no-this-before-super": "off",
|
|
57
|
+
"no-undef": "off",
|
|
58
|
+
"no-unexpected-multiline": "off",
|
|
59
|
+
"no-unmodified-loop-condition": "error",
|
|
60
|
+
"no-unreachable": "off",
|
|
61
|
+
"no-unreachable-loop": "error",
|
|
62
|
+
"no-unsafe-finally": "error",
|
|
63
|
+
"no-unsafe-negation": "off",
|
|
64
|
+
"no-unsafe-optional-chaining": "error",
|
|
65
|
+
"no-unused-private-class-members": "error",
|
|
66
|
+
"no-unused-vars": "off",
|
|
67
|
+
"no-use-before-define": "off",
|
|
68
|
+
"no-useless-backreference": "error",
|
|
69
|
+
"require-atomic-updates": "error",
|
|
70
|
+
"use-isnan": "error",
|
|
71
|
+
"valid-typeof": "off",
|
|
72
|
+
"accessor-pairs": "off",
|
|
73
|
+
"arrow-body-style": "off",
|
|
74
|
+
"block-scoped-var": "error",
|
|
75
|
+
"camelcase": "off",
|
|
76
|
+
"capitalized-comments": "error",
|
|
77
|
+
"class-methods-use-this": "off",
|
|
78
|
+
"complexity": "off",
|
|
79
|
+
"consistent-return": "off",
|
|
80
|
+
"consistent-this": "off",
|
|
81
|
+
"curly": "off",
|
|
82
|
+
"default-case": "off",
|
|
83
|
+
"default-case-last": "error",
|
|
84
|
+
"default-param-last": "off",
|
|
85
|
+
"dot-notation": "off",
|
|
86
|
+
"eqeqeq": ["error", "smart"],
|
|
87
|
+
"func-name-matching": "off",
|
|
88
|
+
"func-names": ["error", "as-needed"],
|
|
89
|
+
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
90
|
+
"guard-for-in": "off",
|
|
91
|
+
"id-denylist": "off",
|
|
92
|
+
"id-length": "off",
|
|
93
|
+
"id-match": "off",
|
|
94
|
+
"init-declarations": "off",
|
|
95
|
+
"logical-assignment-operators": ["error", "always"],
|
|
96
|
+
"max-classes-per-file": "off",
|
|
97
|
+
"max-depth": "off",
|
|
98
|
+
"max-lines": "off",
|
|
99
|
+
"max-lines-per-function": "off",
|
|
100
|
+
"max-nested-callbacks": "off",
|
|
101
|
+
"max-params": "off",
|
|
102
|
+
"max-statements": "off",
|
|
103
|
+
"multiline-comment-style": "error",
|
|
104
|
+
"new-cap": ["error", { "capIsNew": false }],
|
|
105
|
+
"no-alert": "error",
|
|
106
|
+
"no-array-constructor": "off",
|
|
107
|
+
"no-bitwise": "off",
|
|
108
|
+
"no-caller": "error",
|
|
109
|
+
"no-case-declarations": "error",
|
|
110
|
+
"no-confusing-arrow": "off",
|
|
111
|
+
"no-console": "off",
|
|
112
|
+
"no-continue": "off",
|
|
113
|
+
"no-delete-var": "error",
|
|
114
|
+
"no-div-regex": "error",
|
|
115
|
+
"no-else-return": "error",
|
|
116
|
+
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
117
|
+
"no-empty-function": "off",
|
|
118
|
+
"no-empty-static-block": "error",
|
|
119
|
+
"no-eq-null": "off",
|
|
120
|
+
"no-eval": "error",
|
|
121
|
+
"no-extend-native": "error",
|
|
122
|
+
"no-extra-bind": "error",
|
|
123
|
+
"no-extra-boolean-cast": "error",
|
|
124
|
+
"no-extra-label": "error",
|
|
125
|
+
"no-extra-semi": "off",
|
|
126
|
+
"no-floating-decimal": "off",
|
|
127
|
+
"no-global-assign": "error",
|
|
128
|
+
"no-implicit-coercion": "off",
|
|
129
|
+
"no-implicit-globals": "off",
|
|
130
|
+
"no-implied-eval": "off",
|
|
131
|
+
"no-inline-comments": "error",
|
|
132
|
+
"no-invalid-this": "off",
|
|
133
|
+
"no-iterator": "error",
|
|
134
|
+
"no-label-var": "error",
|
|
135
|
+
"no-labels": ["error", { "allowLoop": true }],
|
|
136
|
+
"no-lone-blocks": "error",
|
|
137
|
+
"no-lonely-if": "off",
|
|
138
|
+
"no-loop-func": "off",
|
|
139
|
+
"no-magic-numbers": "off",
|
|
140
|
+
"no-mixed-operators": "off",
|
|
141
|
+
"no-multi-assign": "error",
|
|
142
|
+
"no-multi-str": "error",
|
|
143
|
+
"no-negated-condition": "error",
|
|
144
|
+
"no-nested-ternary": "error",
|
|
145
|
+
"no-new": "error",
|
|
146
|
+
"no-new-func": "error",
|
|
147
|
+
"no-new-object": "error",
|
|
148
|
+
"no-new-wrappers": "error",
|
|
149
|
+
"no-nonoctal-decimal-escape": "error",
|
|
150
|
+
"no-octal": "error",
|
|
151
|
+
"no-octal-escape": "error",
|
|
152
|
+
"no-param-reassign": "off",
|
|
153
|
+
"no-plusplus": "error",
|
|
154
|
+
"no-proto": "error",
|
|
155
|
+
"no-redeclare": "off",
|
|
156
|
+
"no-regex-spaces": "error",
|
|
157
|
+
"no-restricted-exports": "off",
|
|
158
|
+
"no-restricted-globals": "off",
|
|
159
|
+
"no-restricted-imports": "off",
|
|
160
|
+
"no-restricted-properties": "off",
|
|
161
|
+
"no-restricted-syntax": "off",
|
|
162
|
+
"no-return-assign": "error",
|
|
163
|
+
"no-return-await": "off",
|
|
164
|
+
"no-script-url": "error",
|
|
165
|
+
"no-sequences": "error",
|
|
166
|
+
"no-shadow": "off",
|
|
167
|
+
"no-shadow-restricted-names": "error",
|
|
168
|
+
"no-ternary": "off",
|
|
169
|
+
"no-throw-literal": "off",
|
|
170
|
+
"no-undef-init": "off",
|
|
171
|
+
"no-undefined": "off",
|
|
172
|
+
"no-underscore-dangle": "off",
|
|
173
|
+
"no-unneeded-ternary": "error",
|
|
174
|
+
"no-unused-expressions": "off",
|
|
175
|
+
"no-unused-labels": "error",
|
|
176
|
+
"no-useless-call": "error",
|
|
177
|
+
"no-useless-catch": "off",
|
|
178
|
+
"no-useless-computed-key": "error",
|
|
179
|
+
"no-useless-concat": "error",
|
|
180
|
+
"no-useless-constructor": "off",
|
|
181
|
+
"no-useless-escape": "error",
|
|
182
|
+
"no-useless-rename": "error",
|
|
183
|
+
"no-useless-return": "off",
|
|
184
|
+
"no-var": "off",
|
|
185
|
+
"no-void": "error",
|
|
186
|
+
"no-warning-comments": "off",
|
|
187
|
+
"no-with": "error",
|
|
188
|
+
"object-shorthand": "off",
|
|
189
|
+
"one-var": "off",
|
|
190
|
+
"one-var-declaration-per-line": "off",
|
|
191
|
+
"operator-assignment": "error",
|
|
192
|
+
"prefer-arrow-callback": "off",
|
|
193
|
+
"prefer-const": "off",
|
|
194
|
+
"prefer-destructuring": "error",
|
|
195
|
+
"prefer-exponentiation-operator": "error",
|
|
196
|
+
"prefer-named-capture-group": "error",
|
|
197
|
+
"prefer-numeric-literals": "error",
|
|
198
|
+
"prefer-object-has-own": "error",
|
|
199
|
+
"prefer-object-spread": "error",
|
|
200
|
+
"prefer-promise-reject-errors": "off",
|
|
201
|
+
"prefer-regex-literals": "error",
|
|
202
|
+
"prefer-rest-params": "off",
|
|
203
|
+
"prefer-spread": "off",
|
|
204
|
+
"prefer-template": "error",
|
|
205
|
+
"quote-props": "off",
|
|
206
|
+
"radix": "error",
|
|
207
|
+
"require-await": "off",
|
|
208
|
+
"require-unicode-regexp": "error",
|
|
209
|
+
"require-yield": "error",
|
|
210
|
+
"sort-imports": "off",
|
|
211
|
+
"sort-keys": "off",
|
|
212
|
+
"sort-vars": "off",
|
|
213
|
+
"spaced-comment": "off",
|
|
214
|
+
"strict": "off",
|
|
215
|
+
"symbol-description": "error",
|
|
216
|
+
"vars-on-top": "off",
|
|
217
|
+
"yoda": "error",
|
|
218
|
+
"array-bracket-newline": "off",
|
|
219
|
+
"array-bracket-spacing": "off",
|
|
220
|
+
"array-element-newline": "off",
|
|
221
|
+
"arrow-parens": "off",
|
|
222
|
+
"arrow-spacing": "off",
|
|
223
|
+
"block-spacing": "off",
|
|
224
|
+
"brace-style": "off",
|
|
225
|
+
"comma-dangle": "off",
|
|
226
|
+
"comma-spacing": "off",
|
|
227
|
+
"comma-style": "off",
|
|
228
|
+
"computed-property-spacing": "off",
|
|
229
|
+
"dot-location": "off",
|
|
230
|
+
"eol-last": "off",
|
|
231
|
+
"func-call-spacing": "off",
|
|
232
|
+
"function-call-argument-newline": "off",
|
|
233
|
+
"function-paren-newline": "off",
|
|
234
|
+
"generator-star-spacing": "off",
|
|
235
|
+
"implicit-arrow-linebreak": "off",
|
|
236
|
+
"indent": "off",
|
|
237
|
+
"jsx-quotes": "off",
|
|
238
|
+
"key-spacing": "off",
|
|
239
|
+
"keyword-spacing": "off",
|
|
240
|
+
"line-comment-position": "error",
|
|
241
|
+
"linebreak-style": "off",
|
|
242
|
+
"lines-around-comment": "off",
|
|
243
|
+
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
|
|
244
|
+
"max-len": "off",
|
|
245
|
+
"max-statements-per-line": "off",
|
|
246
|
+
"multiline-ternary": "off",
|
|
247
|
+
"new-parens": "off",
|
|
248
|
+
"newline-per-chained-call": "off",
|
|
249
|
+
"no-extra-parens": "off",
|
|
250
|
+
"no-mixed-spaces-and-tabs": "off",
|
|
251
|
+
"no-multi-spaces": "off",
|
|
252
|
+
"no-multiple-empty-lines": "off",
|
|
253
|
+
"no-tabs": "off",
|
|
254
|
+
"no-trailing-spaces": "off",
|
|
255
|
+
"no-whitespace-before-property": "off",
|
|
256
|
+
"nonblock-statement-body-position": "off",
|
|
257
|
+
"object-curly-newline": "off",
|
|
258
|
+
"object-curly-spacing": "off",
|
|
259
|
+
"object-property-newline": "off",
|
|
260
|
+
"operator-linebreak": "off",
|
|
261
|
+
"padded-blocks": "off",
|
|
262
|
+
"padding-line-between-statements": [
|
|
263
|
+
"error",
|
|
264
|
+
{ "blankLine": "always", "prev": "*", "next": "return" },
|
|
265
|
+
{ "blankLine": "always", "prev": "*", "next": ["const", "let"] },
|
|
266
|
+
{ "blankLine": "always", "prev": ["const", "let"], "next": "*" },
|
|
267
|
+
{ "blankLine": "any", "prev": ["const", "let"], "next" : ["const", "let"] },
|
|
268
|
+
{ "blankLine": "always", "prev": "*", "next": "break" },
|
|
269
|
+
{ "blankLine": "always", "prev": "*", "next": "for" },
|
|
270
|
+
{ "blankLine": "always", "prev": "for", "next": "*" },
|
|
271
|
+
{ "blankLine": "always", "prev": "*", "next": "while" },
|
|
272
|
+
{ "blankLine": "always", "prev": "while", "next": "*" }
|
|
273
|
+
],
|
|
274
|
+
"quotes": "off",
|
|
275
|
+
"rest-spread-spacing": "off",
|
|
276
|
+
"semi": "off",
|
|
277
|
+
"semi-spacing": "off",
|
|
278
|
+
"semi-style": "off",
|
|
279
|
+
"space-before-blocks": "off",
|
|
280
|
+
"space-before-function-paren": "off",
|
|
281
|
+
"space-in-parens": "off",
|
|
282
|
+
"space-infix-ops": "off",
|
|
283
|
+
"space-unary-ops": "off",
|
|
284
|
+
"switch-colon-spacing": "off",
|
|
285
|
+
"template-curly-spacing": "off",
|
|
286
|
+
"template-tag-spacing": "off",
|
|
287
|
+
"unicode-bom": "off",
|
|
288
|
+
"wrap-iife": "off",
|
|
289
|
+
"wrap-regex": "off",
|
|
290
|
+
"yield-star-spacing": "off",
|
|
291
|
+
"prettier/prettier": "error",
|
|
292
|
+
"perfectionist/sort-array-includes": "off",
|
|
293
|
+
"perfectionist/sort-astro-attributes": "off",
|
|
294
|
+
"perfectionist/sort-classes": "off",
|
|
295
|
+
"perfectionist/sort-enums": "off",
|
|
296
|
+
"perfectionist/sort-exports": [
|
|
297
|
+
"error",
|
|
298
|
+
{
|
|
299
|
+
"type": "line-length",
|
|
300
|
+
"order": "desc"
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
"perfectionist/sort-imports": [
|
|
304
|
+
"error",
|
|
305
|
+
{
|
|
306
|
+
"type": "line-length",
|
|
307
|
+
"order": "desc",
|
|
308
|
+
"internal-pattern": ["@/**"],
|
|
309
|
+
"groups": [
|
|
310
|
+
"builtin",
|
|
311
|
+
"external",
|
|
312
|
+
"internal",
|
|
313
|
+
"parent",
|
|
314
|
+
"sibling",
|
|
315
|
+
"index",
|
|
316
|
+
"side-effect"
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"perfectionist/sort-interfaces": "off",
|
|
321
|
+
"perfectionist/sort-jsx-props": "off",
|
|
322
|
+
"perfectionist/sort-maps": "off",
|
|
323
|
+
"perfectionist/sort-named-exports": [
|
|
324
|
+
"error",
|
|
325
|
+
{
|
|
326
|
+
"type": "line-length",
|
|
327
|
+
"order": "desc"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"perfectionist/sort-named-imports": [
|
|
331
|
+
"error",
|
|
332
|
+
{
|
|
333
|
+
"type": "line-length",
|
|
334
|
+
"order": "desc"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"perfectionist/sort-object-types": "off",
|
|
338
|
+
"perfectionist/sort-objects": "off",
|
|
339
|
+
"perfectionist/sort-svelte-attributes": "off",
|
|
340
|
+
"perfectionist/sort-union-types": "off",
|
|
341
|
+
"perfectionist/sort-vue-attributes": "off"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parserOptions": {
|
|
3
|
+
"ecmaFeatures": {
|
|
4
|
+
"jsx": true
|
|
5
|
+
}
|
|
6
|
+
},
|
|
7
|
+
"settings": {
|
|
8
|
+
"react": {
|
|
9
|
+
"version": "detect"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"plugins": [
|
|
13
|
+
"react",
|
|
14
|
+
"react-hooks"
|
|
15
|
+
],
|
|
16
|
+
"rules": {
|
|
17
|
+
"react/boolean-prop-naming": "off",
|
|
18
|
+
"react/button-has-type": "error",
|
|
19
|
+
"react/default-props-match-prop-types": "off",
|
|
20
|
+
"react/destructuring-assignment": ["error", "always"],
|
|
21
|
+
"react/display-name": "off",
|
|
22
|
+
"react/forbid-component-props": "off",
|
|
23
|
+
"react/forbid-dom-props": "off",
|
|
24
|
+
"react/forbid-elements": "off",
|
|
25
|
+
"react/forbid-foreign-prop-types": "off",
|
|
26
|
+
"react/forbid-prop-types": "off",
|
|
27
|
+
"react/function-component-definition": ["error", { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function" }],
|
|
28
|
+
"react/hook-use-state": "error",
|
|
29
|
+
"react/iframe-missing-sandbox": "off",
|
|
30
|
+
"react/jsx-boolean-value": ["error", "never"],
|
|
31
|
+
"react/jsx-child-element-spacing": "off",
|
|
32
|
+
"react/jsx-closing-bracket-location": "off",
|
|
33
|
+
"react/jsx-closing-tag-location": "off",
|
|
34
|
+
"react/jsx-curly-brace-presence": "off",
|
|
35
|
+
"react/jsx-curly-newline": "off",
|
|
36
|
+
"react/jsx-curly-spacing": "off",
|
|
37
|
+
"react/jsx-equals-spacing": "off",
|
|
38
|
+
"react/jsx-filename-extension": "off",
|
|
39
|
+
"react/jsx-first-prop-new-line": "off",
|
|
40
|
+
"react/jsx-fragments": ["error", "element"],
|
|
41
|
+
"react/jsx-handler-names": "error",
|
|
42
|
+
"react/jsx-indent": "off",
|
|
43
|
+
"react/jsx-indent-props": "off",
|
|
44
|
+
"react/jsx-key": "error",
|
|
45
|
+
"react/jsx-max-depth": "off",
|
|
46
|
+
"react/jsx-max-props-per-line": "off",
|
|
47
|
+
"react/jsx-newline": "off",
|
|
48
|
+
"react/jsx-no-bind": "error",
|
|
49
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
50
|
+
"react/jsx-no-constructed-context-values": "error",
|
|
51
|
+
"react/jsx-no-duplicate-props": "error",
|
|
52
|
+
"react/jsx-no-leaked-render": "error",
|
|
53
|
+
"react/jsx-no-literals": "off",
|
|
54
|
+
"react/jsx-no-script-url": "error",
|
|
55
|
+
"react/jsx-no-target-blank": ["error", { "allowReferrer": true, "enforceDynamicLinks": "always", "links": false }],
|
|
56
|
+
"react/jsx-no-undef": "error",
|
|
57
|
+
"react/jsx-no-useless-fragment": "off",
|
|
58
|
+
"react/jsx-one-expression-per-line": "off",
|
|
59
|
+
"react/jsx-pascal-case": "error",
|
|
60
|
+
"react/jsx-props-no-multi-spaces": "off",
|
|
61
|
+
"react/jsx-props-no-spreading": "off",
|
|
62
|
+
"react/jsx-sort-props": "off",
|
|
63
|
+
"react/jsx-tag-spacing": "off",
|
|
64
|
+
"react/jsx-uses-react": "off",
|
|
65
|
+
"react/jsx-uses-vars": "error",
|
|
66
|
+
"react/jsx-wrap-multilines": "off",
|
|
67
|
+
"react/no-access-state-in-setstate": "error",
|
|
68
|
+
"react/no-adjacent-inline-elements": "off",
|
|
69
|
+
"react/no-array-index-key": "error",
|
|
70
|
+
"react/no-arrow-function-lifecycle": "error",
|
|
71
|
+
"react/no-children-prop": "error",
|
|
72
|
+
"react/no-danger": "off",
|
|
73
|
+
"react/no-danger-with-children": "error",
|
|
74
|
+
"react/no-deprecated": "error",
|
|
75
|
+
"react/no-did-mount-set-state": "error",
|
|
76
|
+
"react/no-did-update-set-state": "error",
|
|
77
|
+
"react/no-direct-mutation-state": "error",
|
|
78
|
+
"react/no-find-dom-node": "error",
|
|
79
|
+
"react/no-invalid-html-attribute": "error",
|
|
80
|
+
"react/no-is-mounted": "error",
|
|
81
|
+
"react/no-multi-comp": "error",
|
|
82
|
+
"react/no-namespace": "error",
|
|
83
|
+
"react/no-object-type-as-default-prop": "off",
|
|
84
|
+
"react/no-redundant-should-component-update": "error",
|
|
85
|
+
"react/no-render-return-value": "error",
|
|
86
|
+
"react/no-set-state": "off",
|
|
87
|
+
"react/no-string-refs": "error",
|
|
88
|
+
"react/no-this-in-sfc": "error",
|
|
89
|
+
"react/no-typos": "error",
|
|
90
|
+
"react/no-unescaped-entities": "error",
|
|
91
|
+
"react/no-unknown-property": "error",
|
|
92
|
+
"react/no-unsafe": "off",
|
|
93
|
+
"react/no-unstable-nested-components": "error",
|
|
94
|
+
"react/no-unused-class-component-methods": "off",
|
|
95
|
+
"react/no-unused-prop-types": "off",
|
|
96
|
+
"react/no-unused-state": "off",
|
|
97
|
+
"react/no-will-update-set-state": "error",
|
|
98
|
+
"react/prefer-es6-class": "error",
|
|
99
|
+
"react/prefer-exact-props": "off",
|
|
100
|
+
"react/prefer-read-only-props": "off",
|
|
101
|
+
"react/prefer-stateless-function": "off",
|
|
102
|
+
"react/prop-types": "off",
|
|
103
|
+
"react/react-in-jsx-scope": "off",
|
|
104
|
+
"react/require-default-props": "off",
|
|
105
|
+
"react/require-optimization": "off",
|
|
106
|
+
"react/require-render-return": "error",
|
|
107
|
+
"react/self-closing-comp": "error",
|
|
108
|
+
"react/sort-comp": "off",
|
|
109
|
+
"react/sort-default-props": "off",
|
|
110
|
+
"react/sort-prop-types": "off",
|
|
111
|
+
"react/state-in-constructor": "error",
|
|
112
|
+
"react/static-property-placement": "off",
|
|
113
|
+
"react/style-prop-object": "error",
|
|
114
|
+
"react/void-dom-elements-no-children": "error",
|
|
115
|
+
"react-hooks/rules-of-hooks": "error",
|
|
116
|
+
"react-hooks/exhaustive-deps": "warn"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"project": ["./tsconfig.json"]
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
"@typescript-eslint"
|
|
8
|
+
],
|
|
9
|
+
"rules": {
|
|
10
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
11
|
+
"@typescript-eslint/array-type": ["error", { "default": "array", "readonly": "array" }],
|
|
12
|
+
"@typescript-eslint/await-thenable": "error",
|
|
13
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
14
|
+
"@typescript-eslint/ban-tslint-comment": "error",
|
|
15
|
+
"@typescript-eslint/ban-types": "error",
|
|
16
|
+
"@typescript-eslint/class-literal-property-style": "error",
|
|
17
|
+
"@typescript-eslint/consistent-generic-constructors": "error",
|
|
18
|
+
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
19
|
+
"@typescript-eslint/consistent-type-assertions": "off",
|
|
20
|
+
"@typescript-eslint/consistent-type-definitions": "error",
|
|
21
|
+
"@typescript-eslint/consistent-type-exports": "off",
|
|
22
|
+
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports", "fixStyle": "inline-type-imports" }],
|
|
23
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
24
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
25
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
26
|
+
"@typescript-eslint/member-delimiter-style": "off",
|
|
27
|
+
"@typescript-eslint/member-ordering": "off",
|
|
28
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
29
|
+
"@typescript-eslint/naming-convention": [
|
|
30
|
+
"error",
|
|
31
|
+
{ "selector": "interface", "format": ["StrictPascalCase"], "leadingUnderscore": "forbid", "trailingUnderscore": "forbid", "prefix": ["I"] },
|
|
32
|
+
{ "selector": "typeAlias", "format": ["StrictPascalCase"], "leadingUnderscore": "forbid", "trailingUnderscore": "forbid", "prefix": ["T"] },
|
|
33
|
+
{ "selector": "enum", "format": ["StrictPascalCase"], "leadingUnderscore": "forbid", "trailingUnderscore": "forbid", "prefix": ["E"] }
|
|
34
|
+
],
|
|
35
|
+
"@typescript-eslint/no-base-to-string": "error",
|
|
36
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
37
|
+
"@typescript-eslint/no-confusing-void-expression": ["error", { "ignoreArrowShorthand": true }],
|
|
38
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
39
|
+
"@typescript-eslint/no-dynamic-delete": "error",
|
|
40
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
41
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
42
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
43
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
44
|
+
"@typescript-eslint/no-floating-promises": "off",
|
|
45
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
46
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
47
|
+
"@typescript-eslint/no-invalid-void-type": "error",
|
|
48
|
+
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
49
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
50
|
+
"@typescript-eslint/no-misused-promises": "off",
|
|
51
|
+
"@typescript-eslint/no-namespace": "error",
|
|
52
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
53
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
54
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
55
|
+
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
56
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
57
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
58
|
+
"@typescript-eslint/no-type-alias": "off",
|
|
59
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
60
|
+
"@typescript-eslint/no-unnecessary-condition": "off",
|
|
61
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
62
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
63
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
64
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
65
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
66
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
67
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
68
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
69
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
70
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
71
|
+
"@typescript-eslint/no-useless-empty-export": "error",
|
|
72
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
73
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
74
|
+
"@typescript-eslint/parameter-properties": "off",
|
|
75
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
76
|
+
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
77
|
+
"@typescript-eslint/prefer-for-of": "off",
|
|
78
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
79
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
80
|
+
"@typescript-eslint/prefer-literal-enum-member": ["error", { "allowBitwiseExpressions": true }],
|
|
81
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
82
|
+
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
83
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
84
|
+
"@typescript-eslint/prefer-readonly": "off",
|
|
85
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
86
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
87
|
+
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
88
|
+
"@typescript-eslint/prefer-return-this-type": "error",
|
|
89
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
90
|
+
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
91
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
92
|
+
"@typescript-eslint/require-array-sort-compare": "off",
|
|
93
|
+
"@typescript-eslint/restrict-plus-operands": "error",
|
|
94
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
95
|
+
"@typescript-eslint/sort-type-constituents": "off",
|
|
96
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
97
|
+
"@typescript-eslint/switch-exhaustiveness-check": "off",
|
|
98
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
99
|
+
"@typescript-eslint/typedef": "off",
|
|
100
|
+
"@typescript-eslint/unbound-method": "off",
|
|
101
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
102
|
+
"@typescript-eslint/default-param-last": "error",
|
|
103
|
+
"@typescript-eslint/dot-notation": "error",
|
|
104
|
+
"@typescript-eslint/init-declarations": "off",
|
|
105
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
106
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
107
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
108
|
+
"@typescript-eslint/no-extra-semi": "off",
|
|
109
|
+
"@typescript-eslint/no-implied-eval": "error",
|
|
110
|
+
"@typescript-eslint/no-invalid-this": "error",
|
|
111
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
112
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
113
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
114
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
115
|
+
"@typescript-eslint/no-restricted-imports": "off",
|
|
116
|
+
"@typescript-eslint/no-shadow": "off",
|
|
117
|
+
"@typescript-eslint/no-throw-literal": "off",
|
|
118
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
119
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
120
|
+
"@typescript-eslint/no-use-before-define": "error",
|
|
121
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
122
|
+
"@typescript-eslint/require-await": "off",
|
|
123
|
+
"@typescript-eslint/return-await": "error",
|
|
124
|
+
"@typescript-eslint/brace-style": "off",
|
|
125
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
126
|
+
"@typescript-eslint/comma-spacing": "off",
|
|
127
|
+
"@typescript-eslint/func-call-spacing": "off",
|
|
128
|
+
"@typescript-eslint/indent": "off",
|
|
129
|
+
"@typescript-eslint/keyword-spacing": "off",
|
|
130
|
+
"@typescript-eslint/lines-between-class-members": "off",
|
|
131
|
+
"@typescript-eslint/no-extra-parens": "off",
|
|
132
|
+
"@typescript-eslint/object-curly-spacing": "off",
|
|
133
|
+
"@typescript-eslint/padding-line-between-statements": "off",
|
|
134
|
+
"@typescript-eslint/quotes": "off",
|
|
135
|
+
"@typescript-eslint/semi": "off",
|
|
136
|
+
"@typescript-eslint/space-before-blocks": "off",
|
|
137
|
+
"@typescript-eslint/space-before-function-paren": "off",
|
|
138
|
+
"@typescript-eslint/space-infix-ops": "off",
|
|
139
|
+
"@typescript-eslint/type-annotation-spacing": "off"
|
|
140
|
+
}
|
|
141
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wondermarin/eslint-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Personal ESLint config.",
|
|
5
|
+
"author": "Wondermarin",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"homepage": "https://github.com/wondermarin/eslint-config",
|
|
9
|
+
"repository": "github:wondermarin/eslint-config",
|
|
10
|
+
"main": "configs/base.json",
|
|
11
|
+
"exports": {
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
".": "./configs/base.json",
|
|
14
|
+
"./typescript": "./configs/typescript.json",
|
|
15
|
+
"./react": "./configs/react.json"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"files": [
|
|
19
|
+
"configs"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@typescript-eslint/eslint-plugin": ">=6",
|
|
26
|
+
"@typescript-eslint/parser": ">=6",
|
|
27
|
+
"eslint": ">=8",
|
|
28
|
+
"eslint-plugin-perfectionist": ">=2",
|
|
29
|
+
"eslint-plugin-prettier": ">=5",
|
|
30
|
+
"eslint-plugin-react": ">=7",
|
|
31
|
+
"eslint-plugin-react-hooks": ">=4",
|
|
32
|
+
"prettier": ">=3"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"@typescript-eslint/eslint-plugin": {
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
"@typescript-eslint/parser": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"eslint-plugin-react": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"eslint-plugin-react-hooks": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|