@notmike101/eslint-config-ts 0.0.0-stage → 4.0.9
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/index.js +501 -0
- package/package.json +27 -6
- package/README.md +0 -3
package/index.js
ADDED
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
// This file is generated by scripts/generate-configs.mjs.
|
|
2
|
+
// Do not edit this file directly.
|
|
3
|
+
|
|
4
|
+
import js from '@eslint/js';
|
|
5
|
+
import ts from 'typescript-eslint';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
8
|
+
import eslintPluginImport from 'eslint-plugin-import';
|
|
9
|
+
import eslintPluginSortClassMembers from 'eslint-plugin-sort-class-members';
|
|
10
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
11
|
+
|
|
12
|
+
const nodeModuleFiles = [
|
|
13
|
+
'**/*.config.{ts,mts}',
|
|
14
|
+
'**/.*rc.{ts,mts}',
|
|
15
|
+
'**/{scripts,bin}/**/*.{ts,mts}'
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export default ts.config(
|
|
19
|
+
// https://eslint.org/docs/latest/rules/
|
|
20
|
+
js.configs.recommended,
|
|
21
|
+
// https://typescript-eslint.io/users/configs/#eslint-recommended
|
|
22
|
+
ts.configs.eslintRecommended,
|
|
23
|
+
// https://typescript-eslint.io/users/configs/#recommended
|
|
24
|
+
ts.configs.recommended,
|
|
25
|
+
// https://typescript-eslint.io/users/configs/#stylistic
|
|
26
|
+
ts.configs.stylistic,
|
|
27
|
+
// https://eslint.style/guide/config-presets#configuration-factory
|
|
28
|
+
stylistic.configs.customize({
|
|
29
|
+
indent: 4,
|
|
30
|
+
semi: true,
|
|
31
|
+
jsx: false,
|
|
32
|
+
braceStyle: '1tbs',
|
|
33
|
+
quoteProps: 'as-needed',
|
|
34
|
+
arrowParens: 'always',
|
|
35
|
+
commaDangle: 'always-multiline',
|
|
36
|
+
blockSpacing: true,
|
|
37
|
+
quotes: 'single'
|
|
38
|
+
}),
|
|
39
|
+
{
|
|
40
|
+
languageOptions: {
|
|
41
|
+
parser: ts.parser,
|
|
42
|
+
ecmaVersion: 2_022,
|
|
43
|
+
parserOptions: {
|
|
44
|
+
allowDefaultProject: true,
|
|
45
|
+
projectService: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
plugins: {
|
|
49
|
+
'@typescript-eslint': ts.plugin,
|
|
50
|
+
unicorn: eslintPluginUnicorn,
|
|
51
|
+
import: eslintPluginImport,
|
|
52
|
+
'sort-class-members': eslintPluginSortClassMembers,
|
|
53
|
+
'@stylistic': stylistic,
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
// https://eslint.org/docs/latest/rules/no-multi-assign
|
|
57
|
+
'no-multi-assign': 'warn',
|
|
58
|
+
// https://eslint.org/docs/latest/rules/prefer-const
|
|
59
|
+
'prefer-const': 'error',
|
|
60
|
+
// https://eslint.org/docs/latest/rules/one-var
|
|
61
|
+
'one-var': [
|
|
62
|
+
'warn',
|
|
63
|
+
'never'
|
|
64
|
+
],
|
|
65
|
+
// https://eslint.org/docs/latest/rules/no-var
|
|
66
|
+
'no-var': 'error',
|
|
67
|
+
// https://eslint.org/docs/latest/rules/eqeqeq
|
|
68
|
+
eqeqeq: [
|
|
69
|
+
'warn',
|
|
70
|
+
'always'
|
|
71
|
+
],
|
|
72
|
+
// https://eslint.org/docs/latest/rules/dot-notation
|
|
73
|
+
'dot-notation': 'warn',
|
|
74
|
+
// https://eslint.org/docs/latest/rules/default-case-last
|
|
75
|
+
'default-case-last': 'warn',
|
|
76
|
+
// https://eslint.org/docs/latest/rules/default-param-last
|
|
77
|
+
'default-param-last': 'error',
|
|
78
|
+
// https://eslint.org/docs/latest/rules/no-await-in-loop
|
|
79
|
+
'no-await-in-loop': 'error',
|
|
80
|
+
// https://eslint.org/docs/latest/rules/no-promise-executor-return
|
|
81
|
+
'no-promise-executor-return': 'error',
|
|
82
|
+
// https://eslint.org/docs/latest/rules/arrow-body-style
|
|
83
|
+
'arrow-body-style': [
|
|
84
|
+
'warn',
|
|
85
|
+
'as-needed',
|
|
86
|
+
{
|
|
87
|
+
requireReturnForObjectLiteral: false
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
// https://eslint.org/docs/latest/rules/max-depth
|
|
91
|
+
'max-depth': 'warn',
|
|
92
|
+
// https://eslint.org/docs/latest/rules/no-console
|
|
93
|
+
'no-console': [
|
|
94
|
+
'warn',
|
|
95
|
+
{
|
|
96
|
+
allow: [
|
|
97
|
+
'debug',
|
|
98
|
+
'info',
|
|
99
|
+
'warn',
|
|
100
|
+
'error'
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
// https://eslint.org/docs/latest/rules/no-extend-native
|
|
105
|
+
'no-extend-native': 'error',
|
|
106
|
+
// https://eslint.org/docs/latest/rules/no-extra-bind
|
|
107
|
+
'no-extra-bind': 'error',
|
|
108
|
+
// https://eslint.org/docs/latest/rules/no-lonely-if
|
|
109
|
+
'no-lonely-if': 'warn',
|
|
110
|
+
// https://eslint.org/docs/latest/rules/no-nested-ternary
|
|
111
|
+
'no-nested-ternary': 'warn',
|
|
112
|
+
// https://eslint.org/docs/latest/rules/no-unneeded-ternary
|
|
113
|
+
'no-unneeded-ternary': 'error',
|
|
114
|
+
// https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
115
|
+
'prefer-arrow-callback': 'warn',
|
|
116
|
+
// https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
|
|
117
|
+
'prefer-exponentiation-operator': 'warn',
|
|
118
|
+
// https://eslint.org/docs/latest/rules/prefer-object-has-own
|
|
119
|
+
'prefer-object-has-own': 'error',
|
|
120
|
+
// https://eslint.org/docs/latest/rules/prefer-rest-params
|
|
121
|
+
'prefer-rest-params': 'error',
|
|
122
|
+
// https://eslint.org/docs/latest/rules/prefer-template
|
|
123
|
+
'prefer-template': 'error',
|
|
124
|
+
// https://eslint.org/docs/latest/rules/require-await
|
|
125
|
+
'require-await': 'error',
|
|
126
|
+
// https://eslint.org/docs/latest/rules/yoda
|
|
127
|
+
yoda: 'error',
|
|
128
|
+
// https://eslint.org/docs/latest/rules/curly
|
|
129
|
+
curly: [
|
|
130
|
+
'warn',
|
|
131
|
+
'all'
|
|
132
|
+
],
|
|
133
|
+
|
|
134
|
+
// https://typescript-eslint.io/rules/array-type/
|
|
135
|
+
'@typescript-eslint/array-type': [
|
|
136
|
+
'warn',
|
|
137
|
+
{
|
|
138
|
+
default: 'generic'
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
// https://typescript-eslint.io/rules/no-explicit-any/
|
|
142
|
+
'@typescript-eslint/no-explicit-any': [
|
|
143
|
+
'error',
|
|
144
|
+
{
|
|
145
|
+
fixToUnknown: true,
|
|
146
|
+
ignoreRestArgs: true
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
// https://typescript-eslint.io/rules/naming-convention
|
|
150
|
+
'@typescript-eslint/naming-convention': [
|
|
151
|
+
'error',
|
|
152
|
+
{
|
|
153
|
+
selector: 'default',
|
|
154
|
+
format: [
|
|
155
|
+
'camelCase',
|
|
156
|
+
'snake_case',
|
|
157
|
+
'UPPER_CASE',
|
|
158
|
+
'PascalCase'
|
|
159
|
+
],
|
|
160
|
+
leadingUnderscore: 'forbid',
|
|
161
|
+
trailingUnderscore: 'forbid'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
selector: 'variableLike',
|
|
165
|
+
format: [
|
|
166
|
+
'camelCase',
|
|
167
|
+
'snake_case'
|
|
168
|
+
],
|
|
169
|
+
leadingUnderscore: 'allow',
|
|
170
|
+
trailingUnderscore: 'forbid'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
selector: 'class',
|
|
174
|
+
format: [
|
|
175
|
+
'PascalCase'
|
|
176
|
+
],
|
|
177
|
+
leadingUnderscore: 'forbid',
|
|
178
|
+
trailingUnderscore: 'forbid'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
selector: 'typeLike',
|
|
182
|
+
format: [
|
|
183
|
+
'camelCase',
|
|
184
|
+
'PascalCase',
|
|
185
|
+
'UPPER_CASE'
|
|
186
|
+
],
|
|
187
|
+
leadingUnderscore: 'forbid',
|
|
188
|
+
trailingUnderscore: 'forbid'
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
selector: 'interface',
|
|
192
|
+
format: [
|
|
193
|
+
'PascalCase'
|
|
194
|
+
],
|
|
195
|
+
prefix: [
|
|
196
|
+
'I',
|
|
197
|
+
'Interface'
|
|
198
|
+
],
|
|
199
|
+
leadingUnderscore: 'forbid',
|
|
200
|
+
trailingUnderscore: 'forbid'
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
// https://typescript-eslint.io/rules/no-unnecessary-condition
|
|
204
|
+
'@typescript-eslint/no-unnecessary-condition': [
|
|
205
|
+
'warn',
|
|
206
|
+
{
|
|
207
|
+
allowConstantLoopConditions: true
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
|
|
211
|
+
// https://eslint.style/rules/default/line-comment-position
|
|
212
|
+
'@stylistic/line-comment-position': [
|
|
213
|
+
'warn',
|
|
214
|
+
{
|
|
215
|
+
position: 'above',
|
|
216
|
+
ignorePattern: 'previous|todo',
|
|
217
|
+
applyDefaultIgnorePatterns: true
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
// https://eslint.style/rules/default/multiline-comment-style
|
|
221
|
+
'@stylistic/multiline-comment-style': [
|
|
222
|
+
'error',
|
|
223
|
+
'bare-block'
|
|
224
|
+
],
|
|
225
|
+
// https://eslint.style/rules/default/no-extra-semi
|
|
226
|
+
'@stylistic/no-extra-semi': 'error',
|
|
227
|
+
// https://eslint.style/rules/default/curly-newline
|
|
228
|
+
'@stylistic/curly-newline': [
|
|
229
|
+
'warn',
|
|
230
|
+
'always'
|
|
231
|
+
],
|
|
232
|
+
// https://eslint.style/rules/default/object-curly-newline
|
|
233
|
+
'@stylistic/object-curly-newline': [
|
|
234
|
+
'warn',
|
|
235
|
+
{
|
|
236
|
+
multiline: true,
|
|
237
|
+
consistent: true
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
// https://eslint.style/rules/default/padding-line-between-statements
|
|
241
|
+
'@stylistic/padding-line-between-statements': [
|
|
242
|
+
'warn',
|
|
243
|
+
{
|
|
244
|
+
blankLine: 'always',
|
|
245
|
+
prev: '*',
|
|
246
|
+
next: 'return'
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
blankLine: 'always',
|
|
250
|
+
prev: [
|
|
251
|
+
'const',
|
|
252
|
+
'let'
|
|
253
|
+
],
|
|
254
|
+
next: '*'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
blankLine: 'any',
|
|
258
|
+
prev: [
|
|
259
|
+
'const',
|
|
260
|
+
'let'
|
|
261
|
+
],
|
|
262
|
+
next: [
|
|
263
|
+
'const',
|
|
264
|
+
'let'
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
blankLine: 'always',
|
|
269
|
+
prev: 'block-like',
|
|
270
|
+
next: '*'
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
blankLine: 'always',
|
|
274
|
+
prev: 'import',
|
|
275
|
+
next: '*'
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
blankLine: 'any',
|
|
279
|
+
prev: 'import',
|
|
280
|
+
next: 'import'
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
blankLine: 'always',
|
|
284
|
+
prev: '*',
|
|
285
|
+
next: 'function'
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
blankLine: 'always',
|
|
289
|
+
prev: '*',
|
|
290
|
+
next: 'class'
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
blankLine: 'any',
|
|
294
|
+
prev: 'case',
|
|
295
|
+
next: 'case'
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
blankLine: 'always',
|
|
299
|
+
prev: 'for',
|
|
300
|
+
next: '*'
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
blankLine: 'always',
|
|
304
|
+
prev: '*',
|
|
305
|
+
next: 'for'
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
blankLine: 'always',
|
|
309
|
+
prev: '*',
|
|
310
|
+
next: 'if'
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
// https://eslint.style/rules/default/semi-style
|
|
314
|
+
'@stylistic/semi-style': [
|
|
315
|
+
'error',
|
|
316
|
+
'last'
|
|
317
|
+
],
|
|
318
|
+
// https://eslint.style/rules/default/switch-colon-spacing
|
|
319
|
+
'@stylistic/switch-colon-spacing': [
|
|
320
|
+
'warn',
|
|
321
|
+
{
|
|
322
|
+
after: true,
|
|
323
|
+
before: false
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
|
|
327
|
+
// Sort Class Members plugin rules
|
|
328
|
+
// https://github.com/bryanrsmith/eslint-plugin-sort-class-members?tab=readme-ov-file#configuration
|
|
329
|
+
'sort-class-members/sort-class-members': [
|
|
330
|
+
'warn',
|
|
331
|
+
{
|
|
332
|
+
order: [
|
|
333
|
+
'[conventional-private-properties]',
|
|
334
|
+
'[static-properties]',
|
|
335
|
+
'[properties]',
|
|
336
|
+
'[accessor-pairs]',
|
|
337
|
+
'[constructor]',
|
|
338
|
+
'[static-methods]',
|
|
339
|
+
'[conventional-private-methods]',
|
|
340
|
+
'[methods]'
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
|
|
345
|
+
// Unicorn plugin rules
|
|
346
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
347
|
+
'unicorn/numeric-separators-style': [
|
|
348
|
+
'warn',
|
|
349
|
+
{
|
|
350
|
+
number: {
|
|
351
|
+
minimumDigits: 4,
|
|
352
|
+
groupLength: 3
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
357
|
+
'unicorn/better-regex': 'warn',
|
|
358
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
|
|
359
|
+
'unicorn/consistent-destructuring': 'warn',
|
|
360
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
|
|
361
|
+
'unicorn/consistent-existence-index-check': 'warn',
|
|
362
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
|
|
363
|
+
'unicorn/consistent-function-scoping': 'warn',
|
|
364
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
|
|
365
|
+
'unicorn/empty-brace-spaces': 'warn',
|
|
366
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
367
|
+
'unicorn/escape-case': 'warn',
|
|
368
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
369
|
+
'unicorn/new-for-builtins': 'warn',
|
|
370
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
|
|
371
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
372
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
|
|
373
|
+
'unicorn/no-array-for-each': 'error',
|
|
374
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md
|
|
375
|
+
'unicorn/no-array-push-push': 'error',
|
|
376
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
|
|
377
|
+
'unicorn/no-array-reduce': 'error',
|
|
378
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
|
|
379
|
+
'unicorn/no-empty-file': 'warn',
|
|
380
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
381
|
+
'unicorn/no-for-loop': 'error',
|
|
382
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md
|
|
383
|
+
'unicorn/no-instanceof-builtins': 'error',
|
|
384
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md
|
|
385
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
386
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
|
|
387
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
388
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negation-in-equality-check.md
|
|
389
|
+
'unicorn/no-negation-in-equality-check': 'warn',
|
|
390
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
391
|
+
'unicorn/no-new-array': 'error',
|
|
392
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
|
|
393
|
+
'unicorn/no-unnecessary-await': 'warn',
|
|
394
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
|
|
395
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
396
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
|
|
397
|
+
'unicorn/number-literal-case': 'warn',
|
|
398
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
399
|
+
'unicorn/prefer-add-event-listener': 'warn',
|
|
400
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
|
|
401
|
+
'unicorn/prefer-default-parameters': 'warn',
|
|
402
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
|
|
403
|
+
'unicorn/prefer-dom-node-dataset': 'warn',
|
|
404
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
|
|
405
|
+
'unicorn/prefer-dom-node-remove': 'warn',
|
|
406
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md
|
|
407
|
+
'unicorn/prefer-dom-node-append': 'warn',
|
|
408
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
|
|
409
|
+
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
410
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
|
|
411
|
+
'unicorn/prefer-global-this': 'warn',
|
|
412
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
|
|
413
|
+
'unicorn/prefer-keyboard-event-key': 'warn',
|
|
414
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md
|
|
415
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
416
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
|
|
417
|
+
'unicorn/prefer-math-trunc': 'warn',
|
|
418
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
|
|
419
|
+
'unicorn/prefer-modern-dom-apis': 'warn',
|
|
420
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
|
|
421
|
+
'unicorn/prefer-modern-math-apis': 'warn',
|
|
422
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
|
|
423
|
+
'unicorn/prefer-negative-index': 'warn',
|
|
424
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
425
|
+
'unicorn/prefer-node-protocol': 'warn',
|
|
426
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
|
|
427
|
+
'unicorn/prefer-number-properties': 'warn',
|
|
428
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
|
|
429
|
+
'unicorn/prefer-regexp-test': 'warn',
|
|
430
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
431
|
+
'unicorn/prefer-string-replace-all': 'warn',
|
|
432
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
|
|
433
|
+
'unicorn/prefer-string-trim-start-end': 'warn',
|
|
434
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
|
|
435
|
+
'unicorn/prefer-switch': 'warn',
|
|
436
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
437
|
+
'unicorn/prefer-type-error': 'warn',
|
|
438
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
|
|
439
|
+
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
440
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
|
|
441
|
+
'unicorn/throw-new-error': 'warn',
|
|
442
|
+
|
|
443
|
+
// Import plugin rules
|
|
444
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
445
|
+
'import/order': [
|
|
446
|
+
'error',
|
|
447
|
+
{
|
|
448
|
+
groups: [
|
|
449
|
+
'builtin',
|
|
450
|
+
'external',
|
|
451
|
+
'internal',
|
|
452
|
+
'parent',
|
|
453
|
+
'sibling',
|
|
454
|
+
'index'
|
|
455
|
+
],
|
|
456
|
+
alphabetize: {
|
|
457
|
+
order: 'asc',
|
|
458
|
+
caseInsensitive: true
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-mutable-exports.md
|
|
463
|
+
'import/no-mutable-exports': 'error',
|
|
464
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/exports-last.md
|
|
465
|
+
'import/exports-last': 'error',
|
|
466
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/first.md
|
|
467
|
+
'import/first': 'error',
|
|
468
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/newline-after-import.md
|
|
469
|
+
'import/newline-after-import': 'warn',
|
|
470
|
+
// https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-namespace.md
|
|
471
|
+
'import/no-namespace': 'warn',
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
files: ['**/*.{ts,mts,tsx}'],
|
|
476
|
+
ignores: nodeModuleFiles,
|
|
477
|
+
languageOptions: {
|
|
478
|
+
globals: {
|
|
479
|
+
...globals.browser,
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
files: nodeModuleFiles,
|
|
485
|
+
languageOptions: {
|
|
486
|
+
globals: {
|
|
487
|
+
...globals.nodeBuiltin,
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
files: ['**/*.cts'],
|
|
493
|
+
languageOptions: {
|
|
494
|
+
sourceType: 'commonjs',
|
|
495
|
+
globals: {
|
|
496
|
+
...globals.nodeBuiltin,
|
|
497
|
+
...globals.commonjs,
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@notmike101/eslint-config-ts",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@notmike101/eslint-config-ts",
|
|
3
|
+
"version": "4.0.9",
|
|
4
|
+
"author": "Mike Orozco <me@mikeorozco.dev>",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@eslint/js": ">= 9.39.4",
|
|
7
|
+
"eslint": ">= 9.39.4",
|
|
8
|
+
"globals": ">= 17.5.0",
|
|
9
|
+
"typescript-eslint": ">= 8.58.2",
|
|
10
|
+
"typescript": ">=4.8.4 <6.1.0",
|
|
11
|
+
"@stylistic/eslint-plugin": ">= 5.10.0",
|
|
12
|
+
"eslint-plugin-import": ">= 2.32.0",
|
|
13
|
+
"eslint-plugin-sort-class-members": ">= 1.22.1",
|
|
14
|
+
"eslint-plugin-unicorn": ">= 64.0.0"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": "^20.10.0 || >=21.0.0"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./index.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "index.js"
|
|
27
|
+
}
|
package/README.md
DELETED