@ivanmaxlogiudice/eslint-config 3.0.0-beta.3 → 3.0.0-beta.4
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/dist/cli.js +2 -2
- package/dist/index.d.ts +87 -35
- package/dist/index.js +743 -651
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// src/configs/comments.ts
|
|
2
2
|
import plugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
function comments() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
name: "ivanmaxlogiudice/comments/rules",
|
|
7
|
+
plugins: {
|
|
8
|
+
"eslint-comments": plugin
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
12
|
+
"eslint-comments/no-aggregating-enable": "error",
|
|
13
|
+
"eslint-comments/no-duplicate-disable": "error",
|
|
14
|
+
"eslint-comments/no-unlimited-disable": "error",
|
|
15
|
+
"eslint-comments/no-unused-enable": "error"
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
];
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
// src/configs/ignores.ts
|
|
20
22
|
import { dedupe, parsePath, toFlatConfig } from "@ivanmaxlogiudice/gitignore";
|
|
@@ -183,35 +185,37 @@ function ignores() {
|
|
|
183
185
|
|
|
184
186
|
// src/configs/imports.ts
|
|
185
187
|
import plugin2 from "eslint-plugin-import-x";
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
function imports() {
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
name: "ivanmaxlogiudice/imports/rules",
|
|
192
|
+
plugins: {
|
|
193
|
+
import: plugin2
|
|
194
|
+
},
|
|
195
|
+
rules: {
|
|
196
|
+
"antfu/import-dedupe": "error",
|
|
197
|
+
"antfu/no-import-dist": "error",
|
|
198
|
+
"antfu/no-import-node-modules-by-path": "error",
|
|
199
|
+
"import/first": "error",
|
|
200
|
+
"import/no-duplicates": "error",
|
|
201
|
+
"import/no-mutable-exports": "error",
|
|
202
|
+
"import/no-named-default": "error",
|
|
203
|
+
"import/no-self-import": "error",
|
|
204
|
+
"import/no-webpack-loader-syntax": "error",
|
|
205
|
+
// Stylistic
|
|
206
|
+
"import/newline-after-import": ["error", { count: 1 }]
|
|
207
|
+
}
|
|
191
208
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"import/no-named-default": "error",
|
|
200
|
-
"import/no-self-import": "error",
|
|
201
|
-
"import/no-webpack-loader-syntax": "error",
|
|
202
|
-
// Stylistic
|
|
203
|
-
"import/newline-after-import": ["error", { count: 1 }]
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
name: "ivanmaxlogiudice/imports/disables/bin",
|
|
208
|
-
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
209
|
-
rules: {
|
|
210
|
-
"antfu/no-import-dist": "off",
|
|
211
|
-
"antfu/no-import-node-modules-by-path": "off"
|
|
209
|
+
{
|
|
210
|
+
name: "ivanmaxlogiudice/imports/disables/bin",
|
|
211
|
+
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
212
|
+
rules: {
|
|
213
|
+
"antfu/no-import-dist": "off",
|
|
214
|
+
"antfu/no-import-node-modules-by-path": "off"
|
|
215
|
+
}
|
|
212
216
|
}
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
];
|
|
218
|
+
}
|
|
215
219
|
|
|
216
220
|
// src/configs/javascript.ts
|
|
217
221
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
@@ -222,305 +226,323 @@ var restrictedSyntaxJs = [
|
|
|
222
226
|
"LabeledStatement",
|
|
223
227
|
"WithStatement"
|
|
224
228
|
];
|
|
225
|
-
|
|
226
|
-
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
document: "readonly",
|
|
235
|
-
navigator: "readonly",
|
|
236
|
-
window: "readonly"
|
|
237
|
-
},
|
|
238
|
-
parserOptions: {
|
|
239
|
-
ecmaFeatures: {
|
|
240
|
-
jsx: true
|
|
241
|
-
},
|
|
229
|
+
function javascript(options = {}) {
|
|
230
|
+
const {
|
|
231
|
+
isInEditor = false,
|
|
232
|
+
overrides = {}
|
|
233
|
+
} = options;
|
|
234
|
+
return [
|
|
235
|
+
{
|
|
236
|
+
name: "ivanmaxlogiudice/javascript/setup",
|
|
237
|
+
languageOptions: {
|
|
242
238
|
ecmaVersion: 2022,
|
|
239
|
+
globals: {
|
|
240
|
+
...globals.browser,
|
|
241
|
+
...globals.es2021,
|
|
242
|
+
...globals.node,
|
|
243
|
+
document: "readonly",
|
|
244
|
+
navigator: "readonly",
|
|
245
|
+
window: "readonly"
|
|
246
|
+
},
|
|
247
|
+
parserOptions: {
|
|
248
|
+
ecmaFeatures: {
|
|
249
|
+
jsx: true
|
|
250
|
+
},
|
|
251
|
+
ecmaVersion: 2022,
|
|
252
|
+
sourceType: "module"
|
|
253
|
+
},
|
|
243
254
|
sourceType: "module"
|
|
244
255
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
reportUnusedDisableDirectives: true
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
name: "ivanmaxlogiudice/javascript/rules",
|
|
253
|
-
plugins: {
|
|
254
|
-
"antfu": pluginAntfu,
|
|
255
|
-
"unused-imports": pluginUnused
|
|
256
|
+
linterOptions: {
|
|
257
|
+
reportUnusedDisableDirectives: true
|
|
258
|
+
}
|
|
256
259
|
},
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"error",
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
"
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
"no-useless-catch": "error",
|
|
368
|
-
"no-useless-computed-key": "error",
|
|
369
|
-
"no-useless-constructor": "error",
|
|
370
|
-
"no-useless-rename": "error",
|
|
371
|
-
"no-useless-return": "error",
|
|
372
|
-
"no-var": "error",
|
|
373
|
-
"no-with": "error",
|
|
374
|
-
"object-shorthand": [
|
|
375
|
-
"error",
|
|
376
|
-
"always",
|
|
377
|
-
{
|
|
378
|
-
avoidQuotes: true,
|
|
379
|
-
ignoreConstructors: false
|
|
380
|
-
}
|
|
381
|
-
],
|
|
382
|
-
"one-var": ["error", { initialized: "never" }],
|
|
383
|
-
"prefer-arrow-callback": [
|
|
384
|
-
"error",
|
|
385
|
-
{
|
|
386
|
-
allowNamedFunctions: false,
|
|
387
|
-
allowUnboundThis: true
|
|
388
|
-
}
|
|
389
|
-
],
|
|
390
|
-
"prefer-const": [
|
|
391
|
-
"error",
|
|
392
|
-
{
|
|
393
|
-
destructuring: "all",
|
|
394
|
-
ignoreReadBeforeAssign: true
|
|
395
|
-
}
|
|
396
|
-
],
|
|
397
|
-
"prefer-exponentiation-operator": "error",
|
|
398
|
-
"prefer-promise-reject-errors": "error",
|
|
399
|
-
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
400
|
-
"prefer-rest-params": "error",
|
|
401
|
-
"prefer-spread": "error",
|
|
402
|
-
"prefer-template": "error",
|
|
403
|
-
"symbol-description": "error",
|
|
404
|
-
"unicode-bom": ["error", "never"],
|
|
405
|
-
"unused-imports/no-unused-imports": isInEditorEnv() ? "off" : "error",
|
|
406
|
-
"unused-imports/no-unused-vars": [
|
|
407
|
-
"error",
|
|
408
|
-
{
|
|
409
|
-
args: "after-used",
|
|
410
|
-
argsIgnorePattern: "^_",
|
|
260
|
+
{
|
|
261
|
+
name: "ivanmaxlogiudice/javascript/rules",
|
|
262
|
+
plugins: {
|
|
263
|
+
"antfu": pluginAntfu,
|
|
264
|
+
"unused-imports": pluginUnused
|
|
265
|
+
},
|
|
266
|
+
rules: {
|
|
267
|
+
"accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
|
|
268
|
+
"array-callback-return": "error",
|
|
269
|
+
"block-scoped-var": "error",
|
|
270
|
+
"constructor-super": "error",
|
|
271
|
+
"default-case-last": "error",
|
|
272
|
+
"dot-notation": ["error", { allowKeywords: true }],
|
|
273
|
+
"eqeqeq": ["error", "smart"],
|
|
274
|
+
"new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
|
|
275
|
+
"no-alert": "error",
|
|
276
|
+
"no-array-constructor": "error",
|
|
277
|
+
"no-async-promise-executor": "error",
|
|
278
|
+
"no-caller": "error",
|
|
279
|
+
"no-case-declarations": "error",
|
|
280
|
+
"no-class-assign": "error",
|
|
281
|
+
"no-compare-neg-zero": "error",
|
|
282
|
+
"no-cond-assign": ["error", "always"],
|
|
283
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
284
|
+
"no-const-assign": "error",
|
|
285
|
+
"no-control-regex": "error",
|
|
286
|
+
"no-debugger": "error",
|
|
287
|
+
"no-delete-var": "error",
|
|
288
|
+
"no-dupe-args": "error",
|
|
289
|
+
"no-dupe-class-members": "error",
|
|
290
|
+
"no-dupe-keys": "error",
|
|
291
|
+
"no-duplicate-case": "error",
|
|
292
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
293
|
+
"no-empty-character-class": "error",
|
|
294
|
+
"no-empty-pattern": "error",
|
|
295
|
+
"no-eval": "error",
|
|
296
|
+
"no-ex-assign": "error",
|
|
297
|
+
"no-extend-native": "error",
|
|
298
|
+
"no-extra-bind": "error",
|
|
299
|
+
"no-extra-boolean-cast": "error",
|
|
300
|
+
"no-fallthrough": "error",
|
|
301
|
+
"no-func-assign": "error",
|
|
302
|
+
"no-global-assign": "error",
|
|
303
|
+
"no-implied-eval": "error",
|
|
304
|
+
"no-import-assign": "error",
|
|
305
|
+
"no-invalid-regexp": "error",
|
|
306
|
+
"no-irregular-whitespace": "error",
|
|
307
|
+
"no-iterator": "error",
|
|
308
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
309
|
+
"no-lone-blocks": "error",
|
|
310
|
+
"no-loss-of-precision": "error",
|
|
311
|
+
"no-misleading-character-class": "error",
|
|
312
|
+
"no-multi-str": "error",
|
|
313
|
+
"no-new": "error",
|
|
314
|
+
"no-new-func": "error",
|
|
315
|
+
"no-new-native-nonconstructor": "error",
|
|
316
|
+
"no-new-wrappers": "error",
|
|
317
|
+
"no-obj-calls": "error",
|
|
318
|
+
"no-octal": "error",
|
|
319
|
+
"no-octal-escape": "error",
|
|
320
|
+
"no-proto": "error",
|
|
321
|
+
"no-prototype-builtins": "error",
|
|
322
|
+
"no-redeclare": ["error", { builtinGlobals: false }],
|
|
323
|
+
"no-regex-spaces": "error",
|
|
324
|
+
"no-restricted-globals": [
|
|
325
|
+
"error",
|
|
326
|
+
{ name: "global", message: "Use `globalThis` instead." },
|
|
327
|
+
{ name: "self", message: "Use `globalThis` instead." }
|
|
328
|
+
],
|
|
329
|
+
"no-restricted-properties": [
|
|
330
|
+
"error",
|
|
331
|
+
{ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.", property: "__proto__" },
|
|
332
|
+
{ message: "Use `Object.defineProperty` instead.", property: "__defineGetter__" },
|
|
333
|
+
{ message: "Use `Object.defineProperty` instead.", property: "__defineSetter__" },
|
|
334
|
+
{ message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupGetter__" },
|
|
335
|
+
{ message: "Use `Object.getOwnPropertyDescriptor` instead.", property: "__lookupSetter__" }
|
|
336
|
+
],
|
|
337
|
+
"no-restricted-syntax": [
|
|
338
|
+
"error",
|
|
339
|
+
"DebuggerStatement",
|
|
340
|
+
"LabeledStatement",
|
|
341
|
+
"WithStatement",
|
|
342
|
+
"TSEnumDeclaration[const=true]",
|
|
343
|
+
"TSExportAssignment"
|
|
344
|
+
],
|
|
345
|
+
"no-self-assign": ["error", { props: true }],
|
|
346
|
+
"no-self-compare": "error",
|
|
347
|
+
"no-sequences": "error",
|
|
348
|
+
"no-shadow-restricted-names": "error",
|
|
349
|
+
"no-sparse-arrays": "error",
|
|
350
|
+
"no-template-curly-in-string": "error",
|
|
351
|
+
"no-this-before-super": "error",
|
|
352
|
+
"no-throw-literal": "error",
|
|
353
|
+
"no-undef": "error",
|
|
354
|
+
"no-undef-init": "error",
|
|
355
|
+
"no-unexpected-multiline": "error",
|
|
356
|
+
"no-unmodified-loop-condition": "error",
|
|
357
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
358
|
+
"no-unreachable": "error",
|
|
359
|
+
"no-unreachable-loop": "error",
|
|
360
|
+
"no-unsafe-finally": "error",
|
|
361
|
+
"no-unsafe-negation": "error",
|
|
362
|
+
"no-unused-expressions": ["error", {
|
|
363
|
+
allowShortCircuit: true,
|
|
364
|
+
allowTaggedTemplates: true,
|
|
365
|
+
allowTernary: true
|
|
366
|
+
}],
|
|
367
|
+
"no-unused-vars": ["error", {
|
|
368
|
+
args: "none",
|
|
369
|
+
caughtErrors: "none",
|
|
411
370
|
ignoreRestSiblings: true,
|
|
412
|
-
vars: "all"
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
371
|
+
vars: "all"
|
|
372
|
+
}],
|
|
373
|
+
"no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
374
|
+
"no-useless-backreference": "error",
|
|
375
|
+
"no-useless-call": "error",
|
|
376
|
+
"no-useless-catch": "error",
|
|
377
|
+
"no-useless-computed-key": "error",
|
|
378
|
+
"no-useless-constructor": "error",
|
|
379
|
+
"no-useless-rename": "error",
|
|
380
|
+
"no-useless-return": "error",
|
|
381
|
+
"no-var": "error",
|
|
382
|
+
"no-with": "error",
|
|
383
|
+
"object-shorthand": [
|
|
384
|
+
"error",
|
|
385
|
+
"always",
|
|
386
|
+
{
|
|
387
|
+
avoidQuotes: true,
|
|
388
|
+
ignoreConstructors: false
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"one-var": ["error", { initialized: "never" }],
|
|
392
|
+
"prefer-arrow-callback": [
|
|
393
|
+
"error",
|
|
394
|
+
{
|
|
395
|
+
allowNamedFunctions: false,
|
|
396
|
+
allowUnboundThis: true
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"prefer-const": [
|
|
400
|
+
"error",
|
|
401
|
+
{
|
|
402
|
+
destructuring: "all",
|
|
403
|
+
ignoreReadBeforeAssign: true
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"prefer-exponentiation-operator": "error",
|
|
407
|
+
"prefer-promise-reject-errors": "error",
|
|
408
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
409
|
+
"prefer-rest-params": "error",
|
|
410
|
+
"prefer-spread": "error",
|
|
411
|
+
"prefer-template": "error",
|
|
412
|
+
"symbol-description": "error",
|
|
413
|
+
"unicode-bom": ["error", "never"],
|
|
414
|
+
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
415
|
+
"unused-imports/no-unused-vars": [
|
|
416
|
+
"error",
|
|
417
|
+
{
|
|
418
|
+
args: "after-used",
|
|
419
|
+
argsIgnorePattern: "^_",
|
|
420
|
+
ignoreRestSiblings: true,
|
|
421
|
+
vars: "all",
|
|
422
|
+
varsIgnorePattern: "^_"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
|
|
426
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
427
|
+
"vars-on-top": "error",
|
|
428
|
+
"yoda": ["error", "never"],
|
|
429
|
+
...overrides
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "ivanmaxlogiudice/javascript/disables/cli",
|
|
434
|
+
files: [`scripts/${GLOB_SRC}`, `**/cli/${GLOB_SRC}`],
|
|
435
|
+
rules: {
|
|
436
|
+
"no-console": "off"
|
|
437
|
+
}
|
|
427
438
|
}
|
|
428
|
-
|
|
429
|
-
|
|
439
|
+
];
|
|
440
|
+
}
|
|
430
441
|
|
|
431
442
|
// src/configs/jsdoc.ts
|
|
432
443
|
import plugin3 from "eslint-plugin-jsdoc";
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
444
|
+
function jsdoc() {
|
|
445
|
+
return [
|
|
446
|
+
{
|
|
447
|
+
name: "ivanmaxlogiudice/jsdoc/rules",
|
|
448
|
+
plugins: {
|
|
449
|
+
jsdoc: plugin3
|
|
450
|
+
},
|
|
451
|
+
rules: {
|
|
452
|
+
"jsdoc/check-access": "warn",
|
|
453
|
+
"jsdoc/check-param-names": "warn",
|
|
454
|
+
"jsdoc/check-property-names": "warn",
|
|
455
|
+
"jsdoc/check-types": "warn",
|
|
456
|
+
"jsdoc/empty-tags": "warn",
|
|
457
|
+
"jsdoc/implements-on-classes": "warn",
|
|
458
|
+
"jsdoc/no-defaults": "warn",
|
|
459
|
+
"jsdoc/no-multi-asterisks": "warn",
|
|
460
|
+
"jsdoc/require-param-name": "warn",
|
|
461
|
+
"jsdoc/require-property": "warn",
|
|
462
|
+
"jsdoc/require-property-description": "warn",
|
|
463
|
+
"jsdoc/require-property-name": "warn",
|
|
464
|
+
"jsdoc/require-returns-check": "warn",
|
|
465
|
+
"jsdoc/require-returns-description": "warn",
|
|
466
|
+
"jsdoc/require-yields-check": "warn",
|
|
467
|
+
// Stylistic
|
|
468
|
+
"jsdoc/check-alignment": "warn",
|
|
469
|
+
"jsdoc/multiline-blocks": "warn"
|
|
470
|
+
}
|
|
458
471
|
}
|
|
459
|
-
|
|
460
|
-
|
|
472
|
+
];
|
|
473
|
+
}
|
|
461
474
|
|
|
462
475
|
// src/configs/jsonc.ts
|
|
463
476
|
import plugin4 from "eslint-plugin-jsonc";
|
|
464
477
|
import parser from "jsonc-eslint-parser";
|
|
465
|
-
|
|
466
|
-
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
parser
|
|
478
|
+
function jsonc(options = {}) {
|
|
479
|
+
const {
|
|
480
|
+
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
481
|
+
overrides = {}
|
|
482
|
+
} = options;
|
|
483
|
+
return [
|
|
484
|
+
{
|
|
485
|
+
name: "ivanmaxlogiudice/jsonc/setup",
|
|
486
|
+
plugins: {
|
|
487
|
+
jsonc: plugin4
|
|
488
|
+
}
|
|
477
489
|
},
|
|
478
|
-
|
|
479
|
-
"jsonc/
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
490
|
+
{
|
|
491
|
+
name: "ivanmaxlogiudice/jsonc/rules",
|
|
492
|
+
files,
|
|
493
|
+
languageOptions: {
|
|
494
|
+
parser
|
|
495
|
+
},
|
|
496
|
+
rules: {
|
|
497
|
+
"jsonc/no-bigint-literals": "error",
|
|
498
|
+
"jsonc/no-binary-expression": "error",
|
|
499
|
+
"jsonc/no-binary-numeric-literals": "error",
|
|
500
|
+
"jsonc/no-dupe-keys": "error",
|
|
501
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
502
|
+
"jsonc/no-floating-decimal": "error",
|
|
503
|
+
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
504
|
+
"jsonc/no-infinity": "error",
|
|
505
|
+
"jsonc/no-multi-str": "error",
|
|
506
|
+
"jsonc/no-nan": "error",
|
|
507
|
+
"jsonc/no-number-props": "error",
|
|
508
|
+
"jsonc/no-numeric-separators": "error",
|
|
509
|
+
"jsonc/no-octal": "error",
|
|
510
|
+
"jsonc/no-octal-escape": "error",
|
|
511
|
+
"jsonc/no-octal-numeric-literals": "error",
|
|
512
|
+
"jsonc/no-parenthesized": "error",
|
|
513
|
+
"jsonc/no-plus-sign": "error",
|
|
514
|
+
"jsonc/no-regexp-literals": "error",
|
|
515
|
+
"jsonc/no-sparse-arrays": "error",
|
|
516
|
+
"jsonc/no-template-literals": "error",
|
|
517
|
+
"jsonc/no-undefined-value": "error",
|
|
518
|
+
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
519
|
+
"jsonc/no-useless-escape": "error",
|
|
520
|
+
"jsonc/space-unary-ops": "error",
|
|
521
|
+
"jsonc/valid-json-number": "error",
|
|
522
|
+
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
523
|
+
// Stylistic
|
|
524
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
525
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
526
|
+
"jsonc/comma-style": ["error", "last"],
|
|
527
|
+
"jsonc/indent": ["error", 4],
|
|
528
|
+
"jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
529
|
+
"jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
|
|
530
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
531
|
+
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
532
|
+
"jsonc/quote-props": "error",
|
|
533
|
+
"jsonc/quotes": "error",
|
|
534
|
+
...overrides
|
|
535
|
+
}
|
|
516
536
|
}
|
|
517
|
-
|
|
518
|
-
|
|
537
|
+
];
|
|
538
|
+
}
|
|
519
539
|
|
|
520
540
|
// src/configs/markdown.ts
|
|
521
541
|
async function markdown(options = {}) {
|
|
522
542
|
const {
|
|
523
|
-
componentExts = []
|
|
543
|
+
componentExts = [],
|
|
544
|
+
files = [GLOB_MARKDOWN],
|
|
545
|
+
overrides = {}
|
|
524
546
|
} = options;
|
|
525
547
|
await ensurePackages(["eslint-plugin-markdown"]);
|
|
526
548
|
const plugin10 = await interopDefault(import("eslint-plugin-markdown"));
|
|
@@ -533,7 +555,7 @@ async function markdown(options = {}) {
|
|
|
533
555
|
},
|
|
534
556
|
{
|
|
535
557
|
name: "ivanmaxlogiudice/markdown/processor",
|
|
536
|
-
files
|
|
558
|
+
files,
|
|
537
559
|
processor: "markdown/markdown"
|
|
538
560
|
},
|
|
539
561
|
{
|
|
@@ -572,7 +594,8 @@ async function markdown(options = {}) {
|
|
|
572
594
|
"ts/no-use-before-define": "off",
|
|
573
595
|
"unicode-bom": "off",
|
|
574
596
|
"unused-imports/no-unused-imports": "off",
|
|
575
|
-
"unused-imports/no-unused-vars": "off"
|
|
597
|
+
"unused-imports/no-unused-vars": "off",
|
|
598
|
+
...overrides
|
|
576
599
|
}
|
|
577
600
|
}
|
|
578
601
|
];
|
|
@@ -580,63 +603,70 @@ async function markdown(options = {}) {
|
|
|
580
603
|
|
|
581
604
|
// src/configs/node.ts
|
|
582
605
|
import plugin5 from "eslint-plugin-n";
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
606
|
+
function node() {
|
|
607
|
+
return [
|
|
608
|
+
{
|
|
609
|
+
name: "ivanmaxlogiudice/node/rules",
|
|
610
|
+
plugins: {
|
|
611
|
+
node: plugin5
|
|
612
|
+
},
|
|
613
|
+
rules: {
|
|
614
|
+
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
615
|
+
"node/no-deprecated-api": "error",
|
|
616
|
+
"node/no-exports-assign": "error",
|
|
617
|
+
"node/no-new-require": "error",
|
|
618
|
+
"node/no-path-concat": "error",
|
|
619
|
+
"node/no-unsupported-features/es-builtins": "error",
|
|
620
|
+
"node/prefer-global/buffer": ["error", "never"],
|
|
621
|
+
"node/prefer-global/process": ["error", "never"],
|
|
622
|
+
"node/process-exit-as-throw": "error"
|
|
623
|
+
}
|
|
599
624
|
}
|
|
600
|
-
|
|
601
|
-
|
|
625
|
+
];
|
|
626
|
+
}
|
|
602
627
|
|
|
603
628
|
// src/configs/perfectionist.ts
|
|
604
629
|
import plugin6 from "eslint-plugin-perfectionist";
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
630
|
+
function perfectionist() {
|
|
631
|
+
return [
|
|
632
|
+
{
|
|
633
|
+
name: "ivanmaxlogiudice/perfectionist/rules",
|
|
634
|
+
plugins: {
|
|
635
|
+
perfectionist: plugin6
|
|
636
|
+
},
|
|
637
|
+
rules: {
|
|
638
|
+
"perfectionist/sort-imports": ["warn", {
|
|
639
|
+
groups: [
|
|
640
|
+
"builtin",
|
|
641
|
+
"external",
|
|
642
|
+
"internal",
|
|
643
|
+
"internal-type",
|
|
644
|
+
"parent",
|
|
645
|
+
"parent-type",
|
|
646
|
+
"sibling",
|
|
647
|
+
"sibling-type",
|
|
648
|
+
"index",
|
|
649
|
+
"index-type",
|
|
650
|
+
"object",
|
|
651
|
+
"type",
|
|
652
|
+
"side-effect",
|
|
653
|
+
"side-effect-style"
|
|
654
|
+
],
|
|
655
|
+
internalPattern: ["@/**"],
|
|
656
|
+
newlinesBetween: "ignore"
|
|
657
|
+
}],
|
|
658
|
+
"perfectionist/sort-named-exports": ["warn", { groupKind: "values-first" }],
|
|
659
|
+
"perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }]
|
|
660
|
+
}
|
|
634
661
|
}
|
|
635
|
-
|
|
636
|
-
|
|
662
|
+
];
|
|
663
|
+
}
|
|
637
664
|
|
|
638
665
|
// src/configs/regexp.ts
|
|
639
|
-
async function regexp() {
|
|
666
|
+
async function regexp(options = {}) {
|
|
667
|
+
const {
|
|
668
|
+
overrides = {}
|
|
669
|
+
} = options;
|
|
640
670
|
await ensurePackages(["eslint-plugin-regexp"]);
|
|
641
671
|
const plugin10 = await interopDefault(import("eslint-plugin-regexp"));
|
|
642
672
|
return [
|
|
@@ -646,214 +676,219 @@ async function regexp() {
|
|
|
646
676
|
regexp: plugin10
|
|
647
677
|
},
|
|
648
678
|
rules: {
|
|
649
|
-
...plugin10.configs["flat/recommended"].rules
|
|
679
|
+
...plugin10.configs["flat/recommended"].rules,
|
|
680
|
+
...overrides
|
|
650
681
|
}
|
|
651
682
|
}
|
|
652
683
|
];
|
|
653
684
|
}
|
|
654
685
|
|
|
655
686
|
// src/configs/sort.ts
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
"
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
"
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
687
|
+
function sortPackageJson() {
|
|
688
|
+
return [
|
|
689
|
+
{
|
|
690
|
+
name: "ivanmaxlogiudice/sort/packageJson",
|
|
691
|
+
files: ["**/package.json"],
|
|
692
|
+
rules: {
|
|
693
|
+
"jsonc/sort-array-values": [
|
|
694
|
+
"error",
|
|
695
|
+
{
|
|
696
|
+
order: { type: "asc" },
|
|
697
|
+
pathPattern: "^files$"
|
|
698
|
+
}
|
|
699
|
+
],
|
|
700
|
+
"jsonc/sort-keys": [
|
|
701
|
+
"error",
|
|
702
|
+
{
|
|
703
|
+
order: [
|
|
704
|
+
"name",
|
|
705
|
+
"version",
|
|
706
|
+
"private",
|
|
707
|
+
"packageManager",
|
|
708
|
+
"description",
|
|
709
|
+
"type",
|
|
710
|
+
"keywords",
|
|
711
|
+
"license",
|
|
712
|
+
"homepage",
|
|
713
|
+
"bugs",
|
|
714
|
+
"repository",
|
|
715
|
+
"author",
|
|
716
|
+
"contributors",
|
|
717
|
+
"funding",
|
|
718
|
+
"files",
|
|
719
|
+
"main",
|
|
720
|
+
"module",
|
|
721
|
+
"types",
|
|
722
|
+
"exports",
|
|
723
|
+
"typesVersions",
|
|
724
|
+
"sideEffects",
|
|
725
|
+
"unpkg",
|
|
726
|
+
"jsdelivr",
|
|
727
|
+
"browser",
|
|
728
|
+
"bin",
|
|
729
|
+
"man",
|
|
730
|
+
"directories",
|
|
731
|
+
"publishConfig",
|
|
732
|
+
"scripts",
|
|
733
|
+
"peerDependencies",
|
|
734
|
+
"peerDependenciesMeta",
|
|
735
|
+
"optionalDependencies",
|
|
736
|
+
"dependencies",
|
|
737
|
+
"devDependencies",
|
|
738
|
+
"engines",
|
|
739
|
+
"config",
|
|
740
|
+
"overrides",
|
|
741
|
+
"pnpm",
|
|
742
|
+
"husky",
|
|
743
|
+
"lint-staged",
|
|
744
|
+
"eslintConfig",
|
|
745
|
+
"prettier"
|
|
746
|
+
],
|
|
747
|
+
pathPattern: "^$"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
order: { type: "asc" },
|
|
751
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
order: ["types", "require", "import", "default"],
|
|
755
|
+
pathPattern: "^exports.*$"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
order: { type: "asc" },
|
|
759
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
760
|
+
}
|
|
761
|
+
]
|
|
762
|
+
}
|
|
730
763
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
"
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
764
|
+
];
|
|
765
|
+
}
|
|
766
|
+
function sortTsconfig() {
|
|
767
|
+
return [
|
|
768
|
+
{
|
|
769
|
+
name: "ivanmaxlogiudice/sort/tsconfig",
|
|
770
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
771
|
+
rules: {
|
|
772
|
+
"jsonc/sort-keys": [
|
|
773
|
+
"error",
|
|
774
|
+
{
|
|
775
|
+
order: [
|
|
776
|
+
"extends",
|
|
777
|
+
"compilerOptions",
|
|
778
|
+
"references",
|
|
779
|
+
"files",
|
|
780
|
+
"include",
|
|
781
|
+
"exclude"
|
|
782
|
+
],
|
|
783
|
+
pathPattern: "^$"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
order: [
|
|
787
|
+
/* Projects */
|
|
788
|
+
"incremental",
|
|
789
|
+
"composite",
|
|
790
|
+
"tsBuildInfoFile",
|
|
791
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
792
|
+
"disableSolutionSearching",
|
|
793
|
+
"disableReferencedProjectLoad",
|
|
794
|
+
/* Language and Environment */
|
|
795
|
+
"target",
|
|
796
|
+
"jsx",
|
|
797
|
+
"jsxFactory",
|
|
798
|
+
"jsxFragmentFactory",
|
|
799
|
+
"jsxImportSource",
|
|
800
|
+
"lib",
|
|
801
|
+
"moduleDetection",
|
|
802
|
+
"noLib",
|
|
803
|
+
"reactNamespace",
|
|
804
|
+
"useDefineForClassFields",
|
|
805
|
+
"emitDecoratorMetadata",
|
|
806
|
+
"experimentalDecorators",
|
|
807
|
+
/* Modules */
|
|
808
|
+
"baseUrl",
|
|
809
|
+
"rootDir",
|
|
810
|
+
"rootDirs",
|
|
811
|
+
"customConditions",
|
|
812
|
+
"module",
|
|
813
|
+
"moduleResolution",
|
|
814
|
+
"moduleSuffixes",
|
|
815
|
+
"noResolve",
|
|
816
|
+
"paths",
|
|
817
|
+
"resolveJsonModule",
|
|
818
|
+
"resolvePackageJsonExports",
|
|
819
|
+
"resolvePackageJsonImports",
|
|
820
|
+
"typeRoots",
|
|
821
|
+
"types",
|
|
822
|
+
"allowArbitraryExtensions",
|
|
823
|
+
"allowImportingTsExtensions",
|
|
824
|
+
"allowUmdGlobalAccess",
|
|
825
|
+
/* JavaScript Support */
|
|
826
|
+
"allowJs",
|
|
827
|
+
"checkJs",
|
|
828
|
+
"maxNodeModuleJsDepth",
|
|
829
|
+
/* Type Checking */
|
|
830
|
+
"strict",
|
|
831
|
+
"strictBindCallApply",
|
|
832
|
+
"strictFunctionTypes",
|
|
833
|
+
"strictNullChecks",
|
|
834
|
+
"strictPropertyInitialization",
|
|
835
|
+
"allowUnreachableCode",
|
|
836
|
+
"allowUnusedLabels",
|
|
837
|
+
"alwaysStrict",
|
|
838
|
+
"exactOptionalPropertyTypes",
|
|
839
|
+
"noFallthroughCasesInSwitch",
|
|
840
|
+
"noImplicitAny",
|
|
841
|
+
"noImplicitOverride",
|
|
842
|
+
"noImplicitReturns",
|
|
843
|
+
"noImplicitThis",
|
|
844
|
+
"noPropertyAccessFromIndexSignature",
|
|
845
|
+
"noUncheckedIndexedAccess",
|
|
846
|
+
"noUnusedLocals",
|
|
847
|
+
"noUnusedParameters",
|
|
848
|
+
"useUnknownInCatchVariables",
|
|
849
|
+
/* Emit */
|
|
850
|
+
"declaration",
|
|
851
|
+
"declarationDir",
|
|
852
|
+
"declarationMap",
|
|
853
|
+
"downlevelIteration",
|
|
854
|
+
"emitBOM",
|
|
855
|
+
"emitDeclarationOnly",
|
|
856
|
+
"importHelpers",
|
|
857
|
+
"importsNotUsedAsValues",
|
|
858
|
+
"inlineSourceMap",
|
|
859
|
+
"inlineSources",
|
|
860
|
+
"isolatedDeclarations",
|
|
861
|
+
"mapRoot",
|
|
862
|
+
"newLine",
|
|
863
|
+
"noEmit",
|
|
864
|
+
"noEmitHelpers",
|
|
865
|
+
"noEmitOnError",
|
|
866
|
+
"outDir",
|
|
867
|
+
"outFile",
|
|
868
|
+
"preserveConstEnums",
|
|
869
|
+
"preserveValueImports",
|
|
870
|
+
"removeComments",
|
|
871
|
+
"sourceMap",
|
|
872
|
+
"sourceRoot",
|
|
873
|
+
"stripInternal",
|
|
874
|
+
/* Interop Constraints */
|
|
875
|
+
"allowSyntheticDefaultImports",
|
|
876
|
+
"esModuleInterop",
|
|
877
|
+
"forceConsistentCasingInFileNames",
|
|
878
|
+
"isolatedModules",
|
|
879
|
+
"preserveSymlinks",
|
|
880
|
+
"verbatimModuleSyntax",
|
|
881
|
+
/* Completeness */
|
|
882
|
+
"skipDefaultLibCheck",
|
|
883
|
+
"skipLibCheck"
|
|
884
|
+
],
|
|
885
|
+
pathPattern: "^compilerOptions$"
|
|
886
|
+
}
|
|
887
|
+
]
|
|
888
|
+
}
|
|
854
889
|
}
|
|
855
|
-
|
|
856
|
-
|
|
890
|
+
];
|
|
891
|
+
}
|
|
857
892
|
|
|
858
893
|
// src/configs/stylistic.ts
|
|
859
894
|
import plugin7 from "@stylistic/eslint-plugin";
|
|
@@ -866,26 +901,37 @@ var config = plugin7.configs.customize({
|
|
|
866
901
|
semi: false
|
|
867
902
|
});
|
|
868
903
|
config.rules["style/indent"][2].offsetTernaryExpressions = false;
|
|
869
|
-
|
|
870
|
-
{
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
904
|
+
function stylistic(options = {}) {
|
|
905
|
+
const {
|
|
906
|
+
overrides = {}
|
|
907
|
+
} = options;
|
|
908
|
+
return [
|
|
909
|
+
{
|
|
910
|
+
name: "ivanmaxlogiudice/stylistic/rules",
|
|
911
|
+
plugins: {
|
|
912
|
+
style: plugin7
|
|
913
|
+
},
|
|
914
|
+
rules: {
|
|
915
|
+
...config.rules,
|
|
916
|
+
"antfu/consistent-list-newline": "error",
|
|
917
|
+
"antfu/curly": "error",
|
|
918
|
+
"antfu/if-newline": "error",
|
|
919
|
+
"antfu/top-level-function": "error",
|
|
920
|
+
"style/function-call-spacing": ["error", "never"],
|
|
921
|
+
...overrides
|
|
922
|
+
}
|
|
882
923
|
}
|
|
883
|
-
|
|
884
|
-
|
|
924
|
+
];
|
|
925
|
+
}
|
|
885
926
|
|
|
886
927
|
// src/configs/test.ts
|
|
887
928
|
var _pluginTest;
|
|
888
|
-
async function test() {
|
|
929
|
+
async function test(options = {}) {
|
|
930
|
+
const {
|
|
931
|
+
files = GLOB_TESTS,
|
|
932
|
+
isInEditor = false,
|
|
933
|
+
overrides = {}
|
|
934
|
+
} = options;
|
|
889
935
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
890
936
|
interopDefault(import("@vitest/eslint-plugin")),
|
|
891
937
|
// @ts-expect-error missing types
|
|
@@ -908,16 +954,17 @@ async function test() {
|
|
|
908
954
|
},
|
|
909
955
|
{
|
|
910
956
|
name: "ivanmaxlogiudice/test/rules",
|
|
911
|
-
files
|
|
957
|
+
files,
|
|
912
958
|
rules: {
|
|
913
959
|
"node/prefer-global/process": "off",
|
|
914
960
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
915
961
|
"test/no-identical-title": "error",
|
|
916
962
|
"test/no-import-node-test": "error",
|
|
917
|
-
"test/no-only-tests":
|
|
963
|
+
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
918
964
|
"test/prefer-hooks-in-order": "error",
|
|
919
965
|
"test/prefer-lowercase-title": "error",
|
|
920
|
-
"ts/explicit-function-return-type": "off"
|
|
966
|
+
"ts/explicit-function-return-type": "off",
|
|
967
|
+
...overrides
|
|
921
968
|
}
|
|
922
969
|
}
|
|
923
970
|
];
|
|
@@ -929,9 +976,10 @@ import parser2 from "@typescript-eslint/parser";
|
|
|
929
976
|
function typescript(options = {}) {
|
|
930
977
|
const {
|
|
931
978
|
componentExts = [],
|
|
979
|
+
overrides = {},
|
|
932
980
|
type = "app"
|
|
933
981
|
} = options;
|
|
934
|
-
const files = [GLOB_TS, ...componentExts.map((ext) => `**/*.${ext}`)];
|
|
982
|
+
const files = options.files ?? [GLOB_TS, ...componentExts.map((ext) => `**/*.${ext}`)];
|
|
935
983
|
return [
|
|
936
984
|
{
|
|
937
985
|
name: "ivanmaxlogiudice/typescript/setup",
|
|
@@ -991,7 +1039,8 @@ function typescript(options = {}) {
|
|
|
991
1039
|
allowHigherOrderFunctions: true,
|
|
992
1040
|
allowIIFEs: true
|
|
993
1041
|
}]
|
|
994
|
-
} : {}
|
|
1042
|
+
} : {},
|
|
1043
|
+
...overrides
|
|
995
1044
|
}
|
|
996
1045
|
},
|
|
997
1046
|
{
|
|
@@ -1023,47 +1072,50 @@ function typescript(options = {}) {
|
|
|
1023
1072
|
|
|
1024
1073
|
// src/configs/unicorn.ts
|
|
1025
1074
|
import plugin9 from "eslint-plugin-unicorn";
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1075
|
+
function unicorn() {
|
|
1076
|
+
return [
|
|
1077
|
+
{
|
|
1078
|
+
name: "ivanmaxlogiudice/unicorn/rules",
|
|
1079
|
+
plugins: {
|
|
1080
|
+
unicorn: plugin9
|
|
1081
|
+
},
|
|
1082
|
+
rules: {
|
|
1083
|
+
// Pass error message when throwing errors
|
|
1084
|
+
"unicorn/error-message": "error",
|
|
1085
|
+
// Uppercase regex escapes
|
|
1086
|
+
"unicorn/escape-case": "error",
|
|
1087
|
+
// Array.isArray instead of instanceof
|
|
1088
|
+
"unicorn/no-instanceof-array": "error",
|
|
1089
|
+
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
1090
|
+
"unicorn/no-new-array": "error",
|
|
1091
|
+
// Prevent deprecated `new Buffer()`
|
|
1092
|
+
"unicorn/no-new-buffer": "error",
|
|
1093
|
+
// Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
|
|
1094
|
+
"unicorn/number-literal-case": "error",
|
|
1095
|
+
// textContent instead of innerText
|
|
1096
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
1097
|
+
// includes over indexOf when checking for existence
|
|
1098
|
+
"unicorn/prefer-includes": "error",
|
|
1099
|
+
// Prefer using the node: protocol
|
|
1100
|
+
"unicorn/prefer-node-protocol": "error",
|
|
1101
|
+
// Prefer using number properties like `Number.isNaN` rather than `isNaN`
|
|
1102
|
+
"unicorn/prefer-number-properties": "error",
|
|
1103
|
+
// String methods startsWith/endsWith instead of more complicated stuff
|
|
1104
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1105
|
+
// Enforce throwing type error when throwing error while checking typeof
|
|
1106
|
+
"unicorn/prefer-type-error": "error",
|
|
1107
|
+
// Use new when throwing error
|
|
1108
|
+
"unicorn/throw-new-error": "error"
|
|
1109
|
+
}
|
|
1059
1110
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1111
|
+
];
|
|
1112
|
+
}
|
|
1062
1113
|
|
|
1063
1114
|
// src/configs/unocss.ts
|
|
1064
1115
|
async function unocss(options = {}) {
|
|
1065
1116
|
const {
|
|
1066
1117
|
attributify = true,
|
|
1118
|
+
overrides = {},
|
|
1067
1119
|
strict = false
|
|
1068
1120
|
} = options;
|
|
1069
1121
|
await ensurePackages(["@unocss/eslint-plugin"]);
|
|
@@ -1079,7 +1131,8 @@ async function unocss(options = {}) {
|
|
|
1079
1131
|
rules: {
|
|
1080
1132
|
"unocss/order": "warn",
|
|
1081
1133
|
...attributify ? { "unocss/order-attributify": "warn" } : {},
|
|
1082
|
-
...strict ? { "unocss/blocklist": "error" } : {}
|
|
1134
|
+
...strict ? { "unocss/blocklist": "error" } : {},
|
|
1135
|
+
...overrides
|
|
1083
1136
|
}
|
|
1084
1137
|
}
|
|
1085
1138
|
];
|
|
@@ -1087,6 +1140,10 @@ async function unocss(options = {}) {
|
|
|
1087
1140
|
|
|
1088
1141
|
// src/configs/vue.ts
|
|
1089
1142
|
async function vue(options = {}) {
|
|
1143
|
+
const {
|
|
1144
|
+
files = [GLOB_VUE],
|
|
1145
|
+
overrides = {}
|
|
1146
|
+
} = options;
|
|
1090
1147
|
await ensurePackages(["eslint-plugin-vue", "vue-eslint-parser"]);
|
|
1091
1148
|
const [plugin10, parser3] = await Promise.all([
|
|
1092
1149
|
// @ts-expect-error missing types
|
|
@@ -1122,7 +1179,7 @@ async function vue(options = {}) {
|
|
|
1122
1179
|
},
|
|
1123
1180
|
{
|
|
1124
1181
|
name: "ivanmaxlogiudice/vue/rules",
|
|
1125
|
-
files
|
|
1182
|
+
files,
|
|
1126
1183
|
languageOptions: {
|
|
1127
1184
|
parser: parser3,
|
|
1128
1185
|
parserOptions: {
|
|
@@ -1214,14 +1271,19 @@ async function vue(options = {}) {
|
|
|
1214
1271
|
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1215
1272
|
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
1216
1273
|
"vue/space-in-parens": ["error", "never"],
|
|
1217
|
-
"vue/template-curly-spacing": "error"
|
|
1274
|
+
"vue/template-curly-spacing": "error",
|
|
1275
|
+
...overrides
|
|
1218
1276
|
}
|
|
1219
1277
|
}
|
|
1220
1278
|
];
|
|
1221
1279
|
}
|
|
1222
1280
|
|
|
1223
1281
|
// src/configs/yaml.ts
|
|
1224
|
-
async function yaml() {
|
|
1282
|
+
async function yaml(options = {}) {
|
|
1283
|
+
const {
|
|
1284
|
+
files = [GLOB_YAML],
|
|
1285
|
+
overrides = {}
|
|
1286
|
+
} = options;
|
|
1225
1287
|
await ensurePackages(["eslint-plugin-yml", "yaml-eslint-parser"]);
|
|
1226
1288
|
const [plugin10, parser3] = await Promise.all([
|
|
1227
1289
|
interopDefault(import("eslint-plugin-yml")),
|
|
@@ -1236,7 +1298,7 @@ async function yaml() {
|
|
|
1236
1298
|
},
|
|
1237
1299
|
{
|
|
1238
1300
|
name: "ivanmaxlogiudice/yaml/rules",
|
|
1239
|
-
files
|
|
1301
|
+
files,
|
|
1240
1302
|
languageOptions: {
|
|
1241
1303
|
parser: parser3
|
|
1242
1304
|
},
|
|
@@ -1261,7 +1323,8 @@ async function yaml() {
|
|
|
1261
1323
|
"yaml/key-spacing": "error",
|
|
1262
1324
|
"yaml/no-tab-indent": "error",
|
|
1263
1325
|
"yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
|
|
1264
|
-
"yaml/spaced-comment": "error"
|
|
1326
|
+
"yaml/spaced-comment": "error",
|
|
1327
|
+
...overrides
|
|
1265
1328
|
}
|
|
1266
1329
|
}
|
|
1267
1330
|
];
|
|
@@ -1272,25 +1335,33 @@ async function config2(options = {}, ...userConfigs) {
|
|
|
1272
1335
|
clearPackageCache();
|
|
1273
1336
|
const {
|
|
1274
1337
|
componentExts = [],
|
|
1338
|
+
isInEditor = isInEditorEnv(),
|
|
1275
1339
|
regexp: enableRegexp = false,
|
|
1276
1340
|
typescript: enableTypeScript = packageExists("typescript"),
|
|
1277
1341
|
unocss: enableUnoCSS = hasSomePackage(["unocss", "@unocss/nuxt"]),
|
|
1278
1342
|
vue: enableVue = hasSomePackage(["vue", "nuxt", "vitepress", "@slidev/cli"])
|
|
1279
1343
|
} = options;
|
|
1280
1344
|
const configs = [
|
|
1281
|
-
comments,
|
|
1345
|
+
comments(),
|
|
1282
1346
|
ignores(),
|
|
1283
|
-
imports,
|
|
1284
|
-
javascript
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1347
|
+
imports(),
|
|
1348
|
+
javascript({
|
|
1349
|
+
isInEditor,
|
|
1350
|
+
overrides: getOverrides(options, "javascript")
|
|
1351
|
+
}),
|
|
1352
|
+
jsdoc(),
|
|
1353
|
+
node(),
|
|
1354
|
+
perfectionist(),
|
|
1355
|
+
stylistic({
|
|
1356
|
+
overrides: getOverrides(options, "stylistic")
|
|
1357
|
+
}),
|
|
1358
|
+
unicorn(),
|
|
1290
1359
|
// Basic json(c) file support and sorting json keys
|
|
1291
|
-
jsonc
|
|
1292
|
-
|
|
1293
|
-
|
|
1360
|
+
jsonc({
|
|
1361
|
+
overrides: getOverrides(options, "jsonc")
|
|
1362
|
+
}),
|
|
1363
|
+
sortPackageJson(),
|
|
1364
|
+
sortTsconfig()
|
|
1294
1365
|
];
|
|
1295
1366
|
if (enableVue) {
|
|
1296
1367
|
componentExts.push("vue");
|
|
@@ -1298,31 +1369,44 @@ async function config2(options = {}, ...userConfigs) {
|
|
|
1298
1369
|
if (enableTypeScript) {
|
|
1299
1370
|
configs.push(typescript({
|
|
1300
1371
|
componentExts,
|
|
1372
|
+
overrides: getOverrides(options, "typescript"),
|
|
1301
1373
|
type: options.type
|
|
1302
1374
|
}));
|
|
1303
1375
|
}
|
|
1304
1376
|
if (enableRegexp) {
|
|
1305
|
-
configs.push(regexp(
|
|
1377
|
+
configs.push(regexp({
|
|
1378
|
+
overrides: getOverrides(options, "regexp")
|
|
1379
|
+
}));
|
|
1306
1380
|
}
|
|
1307
1381
|
if (options.test ?? true) {
|
|
1308
|
-
configs.push(test(
|
|
1382
|
+
configs.push(test({
|
|
1383
|
+
isInEditor,
|
|
1384
|
+
overrides: getOverrides(options, "test")
|
|
1385
|
+
}));
|
|
1309
1386
|
}
|
|
1310
1387
|
if (enableVue) {
|
|
1311
1388
|
configs.push(vue({
|
|
1312
|
-
|
|
1389
|
+
...resolveSubOptions(options, "vue"),
|
|
1390
|
+
overrides: getOverrides(options, "vue"),
|
|
1391
|
+
typescript: !!enableTypeScript
|
|
1313
1392
|
}));
|
|
1314
1393
|
}
|
|
1315
1394
|
if (enableUnoCSS) {
|
|
1316
1395
|
configs.push(unocss({
|
|
1317
|
-
...resolveSubOptions(options, "unocss")
|
|
1396
|
+
...resolveSubOptions(options, "unocss"),
|
|
1397
|
+
overrides: getOverrides(options, "unocss")
|
|
1318
1398
|
}));
|
|
1319
1399
|
}
|
|
1320
1400
|
if (options.yaml) {
|
|
1321
|
-
configs.push(yaml(
|
|
1401
|
+
configs.push(yaml({
|
|
1402
|
+
overrides: getOverrides(options, "yaml")
|
|
1403
|
+
}));
|
|
1322
1404
|
}
|
|
1323
1405
|
if (options.markdown) {
|
|
1324
1406
|
configs.push(markdown({
|
|
1325
|
-
componentExts
|
|
1407
|
+
componentExts,
|
|
1408
|
+
...resolveSubOptions(options, "markdown"),
|
|
1409
|
+
overrides: getOverrides(options, "markdown")
|
|
1326
1410
|
}));
|
|
1327
1411
|
}
|
|
1328
1412
|
const merged = await combine(
|
|
@@ -1334,6 +1418,13 @@ async function config2(options = {}, ...userConfigs) {
|
|
|
1334
1418
|
function resolveSubOptions(options, key) {
|
|
1335
1419
|
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
1336
1420
|
}
|
|
1421
|
+
function getOverrides(options, key) {
|
|
1422
|
+
const sub = resolveSubOptions(options, key);
|
|
1423
|
+
return {
|
|
1424
|
+
...options.overrides?.[key],
|
|
1425
|
+
..."overrides" in sub ? sub.overrides : {}
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1337
1428
|
|
|
1338
1429
|
// src/index.ts
|
|
1339
1430
|
var src_default = config2;
|
|
@@ -1359,6 +1450,7 @@ export {
|
|
|
1359
1450
|
src_default as default,
|
|
1360
1451
|
ensurePackages,
|
|
1361
1452
|
findUp,
|
|
1453
|
+
getOverrides,
|
|
1362
1454
|
hasSomePackage,
|
|
1363
1455
|
ignores,
|
|
1364
1456
|
imports,
|