@ntnyq/eslint-config 4.0.0-beta.2 → 4.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/index.d.ts +26 -9
- package/dist/index.js +641 -534
- package/package.json +18 -13
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ var GLOB_LOCKFILE = [
|
|
|
124
124
|
"**/package-lock.json",
|
|
125
125
|
"**/yarn.lock",
|
|
126
126
|
"**/pnpm-lock.yaml",
|
|
127
|
-
"**/bun.
|
|
127
|
+
"**/bun.lock?(b)",
|
|
128
128
|
"**/deno.lock"
|
|
129
129
|
];
|
|
130
130
|
var GLOB_EXCLUDE = [
|
|
@@ -184,53 +184,45 @@ var sharedRules = {
|
|
|
184
184
|
...default3.configs["vue3-recommended"].rules
|
|
185
185
|
};
|
|
186
186
|
var disabledRules = {
|
|
187
|
-
"vue/no-v-html": "off",
|
|
188
|
-
"vue/require-prop-types": "off",
|
|
189
|
-
"vue/require-default-prop": "off",
|
|
190
187
|
"vue/multi-word-component-names": "off",
|
|
188
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
189
|
+
"vue/no-v-html": "off",
|
|
191
190
|
"vue/no-v-text-v-html-on-component": "off",
|
|
192
|
-
"vue/
|
|
191
|
+
"vue/require-default-prop": "off",
|
|
192
|
+
"vue/require-prop-types": "off"
|
|
193
193
|
};
|
|
194
194
|
var extensionRules = {
|
|
195
|
-
"vue/prefer-template": "error",
|
|
196
|
-
"vue/no-sparse-arrays": "error",
|
|
197
|
-
"vue/no-empty-pattern": "error",
|
|
198
|
-
"vue/space-infix-ops": "error",
|
|
199
|
-
"vue/no-loss-of-precision": "error",
|
|
200
|
-
"vue/no-constant-condition": "error",
|
|
201
|
-
"vue/template-curly-spacing": "error",
|
|
202
|
-
"vue/eqeqeq": ["error", "smart"],
|
|
203
|
-
"vue/comma-style": ["error", "last"],
|
|
204
|
-
"vue/block-spacing": ["error", "always"],
|
|
205
|
-
"vue/dot-location": ["error", "property"],
|
|
206
|
-
"vue/space-in-parens": ["error", "never"],
|
|
207
|
-
"vue/operator-linebreak": ["error", "before"],
|
|
208
|
-
"vue/no-extra-parens": ["error", "functions"],
|
|
209
195
|
"vue/array-bracket-spacing": ["error", "never"],
|
|
210
|
-
"vue/
|
|
211
|
-
"vue/
|
|
212
|
-
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
213
|
-
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
196
|
+
"vue/arrow-spacing": ["error", { after: true, before: true }],
|
|
197
|
+
"vue/block-spacing": ["error", "always"],
|
|
214
198
|
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
215
|
-
"vue/comma-
|
|
199
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
200
|
+
"vue/comma-spacing": ["error", { after: true, before: false }],
|
|
201
|
+
"vue/comma-style": ["error", "last"],
|
|
202
|
+
"vue/dot-location": ["error", "property"],
|
|
216
203
|
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
217
|
-
"vue/
|
|
218
|
-
"vue/
|
|
219
|
-
"vue/
|
|
220
|
-
"vue/
|
|
204
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
205
|
+
"vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
|
206
|
+
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
|
207
|
+
"vue/no-constant-condition": "error",
|
|
208
|
+
"vue/no-empty-pattern": "error",
|
|
209
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
210
|
+
"vue/no-loss-of-precision": "error",
|
|
211
|
+
"vue/no-restricted-syntax": [
|
|
221
212
|
"error",
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
213
|
+
"DebuggerStatement",
|
|
214
|
+
"LabeledStatement",
|
|
215
|
+
"WithStatement"
|
|
226
216
|
],
|
|
217
|
+
"vue/no-sparse-arrays": "error",
|
|
227
218
|
"vue/object-curly-newline": [
|
|
228
219
|
"error",
|
|
229
220
|
{
|
|
230
|
-
|
|
231
|
-
|
|
221
|
+
consistent: true,
|
|
222
|
+
multiline: true
|
|
232
223
|
}
|
|
233
224
|
],
|
|
225
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
234
226
|
"vue/object-property-newline": [
|
|
235
227
|
"error",
|
|
236
228
|
{
|
|
@@ -241,133 +233,152 @@ var extensionRules = {
|
|
|
241
233
|
"error",
|
|
242
234
|
"always",
|
|
243
235
|
{
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
avoidQuotes: true,
|
|
237
|
+
ignoreConstructors: false
|
|
246
238
|
}
|
|
247
|
-
]
|
|
239
|
+
],
|
|
240
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
241
|
+
"vue/prefer-template": "error",
|
|
242
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
243
|
+
"vue/space-in-parens": ["error", "never"],
|
|
244
|
+
"vue/space-infix-ops": "error",
|
|
245
|
+
"vue/space-unary-ops": [
|
|
246
|
+
"error",
|
|
247
|
+
{
|
|
248
|
+
nonwords: false,
|
|
249
|
+
words: true
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"vue/template-curly-spacing": "error"
|
|
248
253
|
};
|
|
249
254
|
var unCategorizedRules = {
|
|
250
|
-
"vue/
|
|
251
|
-
"vue/no-useless-v-bind": "error",
|
|
252
|
-
"vue/valid-define-options": "error",
|
|
253
|
-
"vue/prefer-define-options": "error",
|
|
254
|
-
"vue/prefer-use-template-ref": "error",
|
|
255
|
-
"vue/no-irregular-whitespace": "error",
|
|
256
|
-
"vue/no-use-v-else-with-v-for": "error",
|
|
257
|
-
"vue/no-deprecated-delete-set": "error",
|
|
258
|
-
"vue/no-empty-component-block": "error",
|
|
259
|
-
"vue/require-typed-object-prop": "error",
|
|
260
|
-
"vue/no-unused-emit-declarations": "error",
|
|
261
|
-
"vue/padding-line-between-blocks": "error",
|
|
262
|
-
"vue/no-multiple-objects-in-class": "error",
|
|
263
|
-
"vue/prefer-separate-static-class": "error",
|
|
264
|
-
"vue/no-ref-object-reactivity-loss": "error",
|
|
265
|
-
"vue/prefer-prop-type-boolean-first": "error",
|
|
266
|
-
"vue/html-comment-indent": ["error", 2],
|
|
267
|
-
"vue/next-tick-style": ["error", "promise"],
|
|
268
|
-
"vue/v-for-delimiter-style": ["error", "in"],
|
|
269
|
-
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
270
|
-
"vue/slot-name-casing": ["error", "kebab-case"],
|
|
271
|
-
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
272
|
-
"vue/define-props-declaration": ["error", "type-based"],
|
|
273
|
-
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
274
|
-
"vue/prefer-true-attribute-shorthand": ["error", "always"],
|
|
275
|
-
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
276
|
-
"vue/component-api-style": ["error", ["script-setup", "composition"]],
|
|
277
|
-
"vue/html-button-has-type": [
|
|
255
|
+
"vue/block-order": [
|
|
278
256
|
"error",
|
|
279
257
|
{
|
|
280
|
-
|
|
281
|
-
submit: true,
|
|
282
|
-
reset: true
|
|
258
|
+
order: ["script", "template", "style"]
|
|
283
259
|
}
|
|
284
260
|
],
|
|
285
|
-
"vue/
|
|
261
|
+
"vue/block-tag-newline": [
|
|
286
262
|
"error",
|
|
287
263
|
{
|
|
288
|
-
|
|
264
|
+
multiline: "always",
|
|
265
|
+
singleline: "always"
|
|
289
266
|
}
|
|
290
267
|
],
|
|
291
|
-
"vue/
|
|
268
|
+
"vue/component-api-style": ["error", ["script-setup", "composition"]],
|
|
269
|
+
"vue/component-name-in-template-casing": [
|
|
292
270
|
"error",
|
|
271
|
+
"PascalCase",
|
|
293
272
|
{
|
|
294
|
-
|
|
273
|
+
ignores: ["slot", "component"],
|
|
274
|
+
// Force auto-import components to be PascalCase
|
|
275
|
+
registeredComponentsOnly: false
|
|
295
276
|
}
|
|
296
277
|
],
|
|
297
|
-
"vue/
|
|
278
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
279
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
280
|
+
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
281
|
+
"vue/define-macros-order": [
|
|
298
282
|
"error",
|
|
299
283
|
{
|
|
300
|
-
|
|
284
|
+
defineExposeLast: true,
|
|
285
|
+
order: [
|
|
286
|
+
"defineProps",
|
|
287
|
+
"defineEmits",
|
|
288
|
+
"defineOptions",
|
|
289
|
+
"defineSlots",
|
|
290
|
+
"defineModel"
|
|
291
|
+
]
|
|
301
292
|
}
|
|
302
293
|
],
|
|
303
|
-
"vue/
|
|
294
|
+
"vue/define-props-declaration": ["error", "type-based"],
|
|
295
|
+
"vue/enforce-style-attribute": [
|
|
304
296
|
"error",
|
|
305
297
|
{
|
|
306
|
-
|
|
307
|
-
multiline: "always"
|
|
298
|
+
allow: ["scoped", "plain"]
|
|
308
299
|
}
|
|
309
300
|
],
|
|
310
|
-
"vue/
|
|
301
|
+
"vue/html-button-has-type": [
|
|
311
302
|
"error",
|
|
312
303
|
{
|
|
313
|
-
|
|
304
|
+
button: true,
|
|
305
|
+
reset: true,
|
|
306
|
+
submit: true
|
|
314
307
|
}
|
|
315
308
|
],
|
|
316
309
|
"vue/html-comment-content-newline": [
|
|
317
310
|
"error",
|
|
318
311
|
{
|
|
319
|
-
|
|
320
|
-
|
|
312
|
+
multiline: "always",
|
|
313
|
+
singleline: "ignore"
|
|
321
314
|
},
|
|
322
315
|
{
|
|
323
316
|
exceptions: ["*"]
|
|
324
317
|
}
|
|
325
318
|
],
|
|
326
|
-
"vue/
|
|
319
|
+
"vue/html-comment-content-spacing": [
|
|
327
320
|
"error",
|
|
321
|
+
"always",
|
|
328
322
|
{
|
|
329
|
-
|
|
323
|
+
exceptions: ["-"]
|
|
330
324
|
}
|
|
331
325
|
],
|
|
326
|
+
"vue/html-comment-indent": ["error", 2],
|
|
327
|
+
"vue/next-tick-style": ["error", "promise"],
|
|
328
|
+
"vue/no-deprecated-delete-set": "error",
|
|
332
329
|
"vue/no-deprecated-model-definition": [
|
|
333
330
|
"error",
|
|
334
331
|
{
|
|
335
332
|
allowVue3Compat: true
|
|
336
333
|
}
|
|
337
334
|
],
|
|
338
|
-
"vue/
|
|
335
|
+
"vue/no-duplicate-attr-inheritance": [
|
|
339
336
|
"error",
|
|
340
|
-
"PascalCase",
|
|
341
337
|
{
|
|
342
|
-
|
|
343
|
-
registeredComponentsOnly: false,
|
|
344
|
-
ignores: ["slot", "component"]
|
|
338
|
+
checkMultiRootNodes: true
|
|
345
339
|
}
|
|
346
340
|
],
|
|
347
|
-
"vue/
|
|
341
|
+
"vue/no-empty-component-block": "error",
|
|
342
|
+
"vue/no-irregular-whitespace": "error",
|
|
343
|
+
"vue/no-multiple-objects-in-class": "error",
|
|
344
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
345
|
+
"vue/no-required-prop-with-default": [
|
|
348
346
|
"error",
|
|
349
347
|
{
|
|
350
|
-
|
|
351
|
-
defineExposeLast: true
|
|
348
|
+
autofix: true
|
|
352
349
|
}
|
|
353
350
|
],
|
|
354
|
-
"vue/
|
|
351
|
+
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
352
|
+
"vue/no-static-inline-styles": [
|
|
355
353
|
"error",
|
|
356
|
-
"always",
|
|
357
354
|
{
|
|
358
|
-
|
|
355
|
+
allowBinding: true
|
|
359
356
|
}
|
|
360
357
|
],
|
|
358
|
+
"vue/no-unused-emit-declarations": "error",
|
|
359
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
360
|
+
"vue/no-useless-v-bind": "error",
|
|
361
|
+
"vue/no-v-text": "error",
|
|
362
|
+
"vue/padding-line-between-blocks": "error",
|
|
363
|
+
"vue/prefer-define-options": "error",
|
|
364
|
+
"vue/prefer-prop-type-boolean-first": "error",
|
|
365
|
+
"vue/prefer-separate-static-class": "error",
|
|
366
|
+
"vue/prefer-true-attribute-shorthand": ["error", "always"],
|
|
367
|
+
"vue/prefer-use-template-ref": "error",
|
|
361
368
|
"vue/require-macro-variable-name": [
|
|
362
369
|
"error",
|
|
363
370
|
{
|
|
364
|
-
defineProps: "props",
|
|
365
371
|
defineEmits: "emits",
|
|
372
|
+
defineProps: "props",
|
|
366
373
|
defineSlots: "slots",
|
|
367
|
-
|
|
368
|
-
|
|
374
|
+
useAttrs: "attrs",
|
|
375
|
+
useSlots: "slots"
|
|
369
376
|
}
|
|
370
|
-
]
|
|
377
|
+
],
|
|
378
|
+
"vue/require-typed-object-prop": "error",
|
|
379
|
+
"vue/slot-name-casing": ["error", "kebab-case"],
|
|
380
|
+
"vue/v-for-delimiter-style": ["error", "in"],
|
|
381
|
+
"vue/valid-define-options": "error"
|
|
371
382
|
};
|
|
372
383
|
var configVue = (options = {}) => {
|
|
373
384
|
const { files = [GLOB_VUE] } = options;
|
|
@@ -390,45 +401,32 @@ var configVue = (options = {}) => {
|
|
|
390
401
|
{
|
|
391
402
|
name: "ntnyq/vue/setup",
|
|
392
403
|
plugins: {
|
|
393
|
-
|
|
394
|
-
|
|
404
|
+
"@typescript-eslint": plugin,
|
|
405
|
+
vue: default3
|
|
395
406
|
}
|
|
396
407
|
},
|
|
397
408
|
{
|
|
398
409
|
name: "ntnyq/vue/rules",
|
|
399
410
|
files,
|
|
411
|
+
processor: getVueProcessor(),
|
|
400
412
|
languageOptions: {
|
|
401
413
|
parser: parserVue,
|
|
402
414
|
parserOptions: {
|
|
403
|
-
sourceType: "module",
|
|
404
415
|
ecmaVersion: "latest",
|
|
405
416
|
extraFileExtensions: [".vue"],
|
|
406
417
|
parser: parserTypeScript,
|
|
418
|
+
sourceType: "module",
|
|
407
419
|
ecmaFeatures: {
|
|
408
420
|
jsx: true
|
|
409
421
|
}
|
|
410
422
|
}
|
|
411
423
|
},
|
|
412
|
-
processor: getVueProcessor(),
|
|
413
424
|
rules: {
|
|
414
425
|
...sharedRules,
|
|
415
|
-
"vue/html-self-closing": [
|
|
416
|
-
"error",
|
|
417
|
-
{
|
|
418
|
-
html: {
|
|
419
|
-
void: "always",
|
|
420
|
-
normal: "always",
|
|
421
|
-
component: "always"
|
|
422
|
-
},
|
|
423
|
-
svg: "always",
|
|
424
|
-
math: "always"
|
|
425
|
-
}
|
|
426
|
-
],
|
|
427
|
-
"vue/this-in-template": ["error", "never"],
|
|
428
|
-
"vue/prop-name-casing": ["error", "camelCase"],
|
|
429
426
|
"vue/attributes-order": [
|
|
430
427
|
"error",
|
|
431
428
|
{
|
|
429
|
+
alphabetical: false,
|
|
432
430
|
order: [
|
|
433
431
|
"EVENTS",
|
|
434
432
|
// `@click="functionCall"`, `v-on="event"`
|
|
@@ -459,8 +457,26 @@ var configVue = (options = {}) => {
|
|
|
459
457
|
// `prop="foo", `static attributes
|
|
460
458
|
"ATTR_SHORTHAND_BOOL"
|
|
461
459
|
// `disabled`, prop shorthand
|
|
462
|
-
]
|
|
463
|
-
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
],
|
|
463
|
+
"vue/html-self-closing": [
|
|
464
|
+
"error",
|
|
465
|
+
{
|
|
466
|
+
math: "always",
|
|
467
|
+
svg: "always",
|
|
468
|
+
html: {
|
|
469
|
+
component: "always",
|
|
470
|
+
normal: "always",
|
|
471
|
+
void: "always"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
],
|
|
475
|
+
"vue/max-attributes-per-line": [
|
|
476
|
+
"error",
|
|
477
|
+
{
|
|
478
|
+
multiline: 1,
|
|
479
|
+
singleline: 1
|
|
464
480
|
}
|
|
465
481
|
],
|
|
466
482
|
"vue/order-in-components": [
|
|
@@ -503,13 +519,8 @@ var configVue = (options = {}) => {
|
|
|
503
519
|
]
|
|
504
520
|
}
|
|
505
521
|
],
|
|
506
|
-
"vue/
|
|
507
|
-
|
|
508
|
-
{
|
|
509
|
-
singleline: 1,
|
|
510
|
-
multiline: 1
|
|
511
|
-
}
|
|
512
|
-
],
|
|
522
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
523
|
+
"vue/this-in-template": ["error", "never"],
|
|
513
524
|
...disabledRules,
|
|
514
525
|
...extensionRules,
|
|
515
526
|
...unCategorizedRules,
|
|
@@ -525,12 +536,12 @@ var configYml = (options = {}) => [
|
|
|
525
536
|
{
|
|
526
537
|
name: "ntnyq/yml",
|
|
527
538
|
files: [GLOB_YAML],
|
|
528
|
-
languageOptions: {
|
|
529
|
-
parser: parserYaml
|
|
530
|
-
},
|
|
531
539
|
plugins: {
|
|
532
540
|
yml: default4
|
|
533
541
|
},
|
|
542
|
+
languageOptions: {
|
|
543
|
+
parser: parserYaml
|
|
544
|
+
},
|
|
534
545
|
rules: {
|
|
535
546
|
...default4.configs.standard.rules,
|
|
536
547
|
...default4.configs.prettier.rules,
|
|
@@ -568,10 +579,12 @@ var configNode = (options = {}) => [
|
|
|
568
579
|
var configSort = (options = {}) => {
|
|
569
580
|
const configs2 = [];
|
|
570
581
|
const {
|
|
571
|
-
|
|
572
|
-
|
|
582
|
+
additionalJsonFiles = [],
|
|
583
|
+
additionalYamlFiles = [],
|
|
573
584
|
i18nLocale: enableSortI18nLocale = true,
|
|
574
|
-
|
|
585
|
+
packageJson: enableSortPackageJson = true,
|
|
586
|
+
pnpmWorkspace: enableSortPnpmWorkspace = true,
|
|
587
|
+
tsconfig: enableSortTsconfig = true
|
|
575
588
|
} = options;
|
|
576
589
|
if (enableSortTsconfig) {
|
|
577
590
|
configs2.push({
|
|
@@ -581,10 +594,20 @@ var configSort = (options = {}) => {
|
|
|
581
594
|
"jsonc/sort-keys": [
|
|
582
595
|
"error",
|
|
583
596
|
{
|
|
584
|
-
|
|
585
|
-
|
|
597
|
+
pathPattern: "^$",
|
|
598
|
+
order: [
|
|
599
|
+
"extends",
|
|
600
|
+
"compilerOptions",
|
|
601
|
+
"references",
|
|
602
|
+
"files",
|
|
603
|
+
"include",
|
|
604
|
+
"exclude",
|
|
605
|
+
// vue.volar
|
|
606
|
+
"vueCompilerOptions"
|
|
607
|
+
]
|
|
586
608
|
},
|
|
587
609
|
{
|
|
610
|
+
pathPattern: "^compilerOptions$",
|
|
588
611
|
order: [
|
|
589
612
|
/* Projects */
|
|
590
613
|
"incremental",
|
|
@@ -682,8 +705,7 @@ var configSort = (options = {}) => {
|
|
|
682
705
|
/* Completeness */
|
|
683
706
|
"skipDefaultLibCheck",
|
|
684
707
|
"skipLibCheck"
|
|
685
|
-
]
|
|
686
|
-
pathPattern: "^compilerOptions$"
|
|
708
|
+
]
|
|
687
709
|
}
|
|
688
710
|
]
|
|
689
711
|
}
|
|
@@ -694,6 +716,25 @@ var configSort = (options = {}) => {
|
|
|
694
716
|
name: "ntnyq/sort/package-json",
|
|
695
717
|
files: ["**/package.json"],
|
|
696
718
|
rules: {
|
|
719
|
+
"jsonc/sort-array-values": [
|
|
720
|
+
"error",
|
|
721
|
+
{
|
|
722
|
+
order: { type: "asc" },
|
|
723
|
+
pathPattern: "^files$"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
order: { type: "asc" },
|
|
727
|
+
pathPattern: "^keywords$"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
order: { type: "asc" },
|
|
731
|
+
pathPattern: "^activationEvents$"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
order: { type: "asc" },
|
|
735
|
+
pathPattern: "^contributes.*$"
|
|
736
|
+
}
|
|
737
|
+
],
|
|
697
738
|
"jsonc/sort-keys": [
|
|
698
739
|
"error",
|
|
699
740
|
{
|
|
@@ -789,8 +830,8 @@ var configSort = (options = {}) => {
|
|
|
789
830
|
]
|
|
790
831
|
},
|
|
791
832
|
{
|
|
792
|
-
|
|
793
|
-
|
|
833
|
+
order: { type: "asc" },
|
|
834
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
794
835
|
},
|
|
795
836
|
{
|
|
796
837
|
order: { type: "asc" },
|
|
@@ -798,7 +839,18 @@ var configSort = (options = {}) => {
|
|
|
798
839
|
},
|
|
799
840
|
{
|
|
800
841
|
pathPattern: "^exports.*$",
|
|
801
|
-
order: [
|
|
842
|
+
order: [
|
|
843
|
+
"./package.json",
|
|
844
|
+
"types",
|
|
845
|
+
"import",
|
|
846
|
+
"require",
|
|
847
|
+
"default",
|
|
848
|
+
{
|
|
849
|
+
order: {
|
|
850
|
+
type: "asc"
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
]
|
|
802
854
|
},
|
|
803
855
|
// VSCode extension
|
|
804
856
|
{
|
|
@@ -810,15 +862,27 @@ var configSort = (options = {}) => {
|
|
|
810
862
|
* @see {@link https://pnpm.io/package_json#publishconfig}
|
|
811
863
|
*/
|
|
812
864
|
{
|
|
813
|
-
|
|
814
|
-
|
|
865
|
+
pathPattern: "^publishConfig.*$",
|
|
866
|
+
order: [
|
|
867
|
+
"./package.json",
|
|
868
|
+
"types",
|
|
869
|
+
"import",
|
|
870
|
+
"require",
|
|
871
|
+
"default",
|
|
872
|
+
{
|
|
873
|
+
order: {
|
|
874
|
+
type: "asc"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
]
|
|
815
878
|
},
|
|
816
879
|
// npm scripts
|
|
817
880
|
{
|
|
818
|
-
|
|
819
|
-
|
|
881
|
+
order: { type: "asc" },
|
|
882
|
+
pathPattern: "^scripts$"
|
|
820
883
|
},
|
|
821
884
|
{
|
|
885
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$",
|
|
822
886
|
order: [
|
|
823
887
|
// client hooks only
|
|
824
888
|
"pre-commit",
|
|
@@ -831,27 +895,7 @@ var configSort = (options = {}) => {
|
|
|
831
895
|
"post-merge",
|
|
832
896
|
"pre-push",
|
|
833
897
|
"pre-auto-gc"
|
|
834
|
-
]
|
|
835
|
-
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
|
|
836
|
-
}
|
|
837
|
-
],
|
|
838
|
-
"jsonc/sort-array-values": [
|
|
839
|
-
"error",
|
|
840
|
-
{
|
|
841
|
-
pathPattern: "^files$",
|
|
842
|
-
order: { type: "asc" }
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
pathPattern: "^keywords$",
|
|
846
|
-
order: { type: "asc" }
|
|
847
|
-
},
|
|
848
|
-
{
|
|
849
|
-
pathPattern: "^activationEvents$",
|
|
850
|
-
order: { type: "asc" }
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
pathPattern: "^contributes.*$",
|
|
854
|
-
order: { type: "asc" }
|
|
898
|
+
]
|
|
855
899
|
}
|
|
856
900
|
]
|
|
857
901
|
}
|
|
@@ -861,26 +905,26 @@ var configSort = (options = {}) => {
|
|
|
861
905
|
configs2.push(
|
|
862
906
|
{
|
|
863
907
|
name: "ntnyq/sort/i18n-locale/json",
|
|
864
|
-
files: ["**/{locales
|
|
908
|
+
files: ["**/{i18n,langs,locales}/*.json"],
|
|
865
909
|
rules: {
|
|
866
910
|
"jsonc/sort-keys": [
|
|
867
911
|
"error",
|
|
868
912
|
{
|
|
869
|
-
|
|
870
|
-
|
|
913
|
+
order: { type: "asc" },
|
|
914
|
+
pathPattern: ".*"
|
|
871
915
|
}
|
|
872
916
|
]
|
|
873
917
|
}
|
|
874
918
|
},
|
|
875
919
|
{
|
|
876
920
|
name: "ntnyq/sort/i18n-locale/yaml",
|
|
877
|
-
files: ["**/{locales
|
|
921
|
+
files: ["**/{i18n,langs,locales}/*.y?(a)ml"],
|
|
878
922
|
rules: {
|
|
879
923
|
"yml/sort-keys": [
|
|
880
924
|
"error",
|
|
881
925
|
{
|
|
882
|
-
|
|
883
|
-
|
|
926
|
+
order: { type: "asc" },
|
|
927
|
+
pathPattern: ".*"
|
|
884
928
|
}
|
|
885
929
|
]
|
|
886
930
|
}
|
|
@@ -895,8 +939,38 @@ var configSort = (options = {}) => {
|
|
|
895
939
|
"yml/sort-keys": [
|
|
896
940
|
"error",
|
|
897
941
|
{
|
|
898
|
-
|
|
899
|
-
|
|
942
|
+
order: { type: "asc" },
|
|
943
|
+
pathPattern: ".*"
|
|
944
|
+
}
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
if (additionalJsonFiles.length) {
|
|
950
|
+
configs2.push({
|
|
951
|
+
name: "ntnyq/sort/additional-json",
|
|
952
|
+
files: additionalJsonFiles,
|
|
953
|
+
rules: {
|
|
954
|
+
"jsonc/sort-keys": [
|
|
955
|
+
"error",
|
|
956
|
+
{
|
|
957
|
+
order: { type: "asc" },
|
|
958
|
+
pathPattern: ".*"
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
if (additionalYamlFiles.length) {
|
|
965
|
+
configs2.push({
|
|
966
|
+
name: "ntnyq/sort/additional-yaml",
|
|
967
|
+
files: additionalYamlFiles,
|
|
968
|
+
rules: {
|
|
969
|
+
"yml/sort-keys": [
|
|
970
|
+
"error",
|
|
971
|
+
{
|
|
972
|
+
order: { type: "asc" },
|
|
973
|
+
pathPattern: ".*"
|
|
900
974
|
}
|
|
901
975
|
]
|
|
902
976
|
}
|
|
@@ -910,32 +984,32 @@ var configToml = (options = {}) => [
|
|
|
910
984
|
{
|
|
911
985
|
name: "ntnyq/toml",
|
|
912
986
|
files: [GLOB_TOML],
|
|
913
|
-
languageOptions: {
|
|
914
|
-
parser: parserToml
|
|
915
|
-
},
|
|
916
987
|
plugins: {
|
|
917
988
|
toml: default6
|
|
918
989
|
},
|
|
990
|
+
languageOptions: {
|
|
991
|
+
parser: parserToml
|
|
992
|
+
},
|
|
919
993
|
rules: {
|
|
920
|
-
"toml/keys-order": "error",
|
|
921
|
-
"toml/key-spacing": "error",
|
|
922
|
-
"toml/quoted-keys": "error",
|
|
923
|
-
"toml/comma-style": "error",
|
|
924
|
-
"toml/tables-order": "error",
|
|
925
|
-
"toml/no-space-dots": "error",
|
|
926
|
-
"toml/spaced-comment": "error",
|
|
927
|
-
"toml/precision-of-integer": "error",
|
|
928
|
-
"toml/table-bracket-spacing": "error",
|
|
929
994
|
"toml/array-bracket-newline": "error",
|
|
995
|
+
"toml/array-bracket-spacing": ["error", "never"],
|
|
996
|
+
"toml/array-element-newline": ["error", "never"],
|
|
997
|
+
"toml/comma-style": "error",
|
|
998
|
+
"toml/indent": ["error", 2],
|
|
930
999
|
"toml/inline-table-curly-spacing": "error",
|
|
1000
|
+
"toml/key-spacing": "error",
|
|
1001
|
+
"toml/keys-order": "error",
|
|
1002
|
+
"toml/no-space-dots": "error",
|
|
1003
|
+
"toml/no-unreadable-number-separator": "error",
|
|
931
1004
|
"toml/padding-line-between-pairs": "error",
|
|
932
1005
|
"toml/padding-line-between-tables": "error",
|
|
933
|
-
"toml/no-unreadable-number-separator": "error",
|
|
934
1006
|
"toml/precision-of-fractional-seconds": "error",
|
|
1007
|
+
"toml/precision-of-integer": "error",
|
|
1008
|
+
"toml/quoted-keys": "error",
|
|
1009
|
+
"toml/spaced-comment": "error",
|
|
1010
|
+
"toml/table-bracket-spacing": "error",
|
|
1011
|
+
"toml/tables-order": "error",
|
|
935
1012
|
"toml/vue-custom-block/no-parsing-error": "error",
|
|
936
|
-
"toml/indent": ["error", 2],
|
|
937
|
-
"toml/array-bracket-spacing": ["error", "never"],
|
|
938
|
-
"toml/array-element-newline": ["error", "never"],
|
|
939
1013
|
// Overrides rules
|
|
940
1014
|
...options.overrides
|
|
941
1015
|
}
|
|
@@ -952,7 +1026,10 @@ var hasTypeScript = () => isPackageExists("typescript");
|
|
|
952
1026
|
var hasShadcnVue = () => isPackageExists("radix-vue") && isPackageExists("clsx");
|
|
953
1027
|
var hasUnoCSS = () => isPackageExists("unocss") || isPackageExists("@unocss/postcss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
|
|
954
1028
|
var hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("vuepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
|
|
955
|
-
paths: [
|
|
1029
|
+
paths: [
|
|
1030
|
+
resolve(process.cwd(), "playground"),
|
|
1031
|
+
resolve(process.cwd(), "docs")
|
|
1032
|
+
]
|
|
956
1033
|
});
|
|
957
1034
|
|
|
958
1035
|
// src/utils/toArray.ts
|
|
@@ -986,9 +1063,7 @@ import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
|
986
1063
|
// src/utils/isInGitHooksOrRunByNanoStagedOrRunByTSX.ts
|
|
987
1064
|
import process2 from "node:process";
|
|
988
1065
|
function isInGitHooksOrRunByNanoStagedOrRunByTSX() {
|
|
989
|
-
return !!(process2.env.GIT_PARAMS || process2.env.VSCODE_GIT_COMMAND ||
|
|
990
|
-
process2.env.npm_lifecycle_script?.startsWith("nano-staged") || // run `scripts/generateType.ts`
|
|
991
|
-
process2.env.npm_lifecycle_script?.startsWith("tsx"));
|
|
1066
|
+
return !!(process2.env.GIT_PARAMS || process2.env.VSCODE_GIT_COMMAND || process2.env.npm_lifecycle_script?.startsWith("nano-staged") || process2.env.npm_lifecycle_script?.startsWith("tsx"));
|
|
992
1067
|
}
|
|
993
1068
|
|
|
994
1069
|
// src/utils/ensurePackages.ts
|
|
@@ -1003,7 +1078,9 @@ async function ensurePackages(packages) {
|
|
|
1003
1078
|
if (process3.env.CI || !process3.stdout.isTTY || isInGitHooksOrRunByNanoStagedOrRunByTSX() || !isCwdInScope) {
|
|
1004
1079
|
return;
|
|
1005
1080
|
}
|
|
1006
|
-
const nonExistingPackages = packages.filter(
|
|
1081
|
+
const nonExistingPackages = packages.filter(
|
|
1082
|
+
(pkg) => !!pkg && !isPackageInScope(pkg)
|
|
1083
|
+
);
|
|
1007
1084
|
if (nonExistingPackages.length === 0) {
|
|
1008
1085
|
return;
|
|
1009
1086
|
}
|
|
@@ -1060,8 +1137,8 @@ var configTest = (options = {}) => {
|
|
|
1060
1137
|
name: "ntnyq/test/base",
|
|
1061
1138
|
files,
|
|
1062
1139
|
rules: {
|
|
1063
|
-
"no-unused-expressions": "off",
|
|
1064
1140
|
"max-lines-per-function": "off",
|
|
1141
|
+
"no-unused-expressions": "off",
|
|
1065
1142
|
"no-only-tests/no-only-tests": "error",
|
|
1066
1143
|
// Overrides rules
|
|
1067
1144
|
...options.overrides
|
|
@@ -1112,8 +1189,8 @@ var configAntfu = (options = {}) => [
|
|
|
1112
1189
|
// required `object-curly-newline` to be disabled
|
|
1113
1190
|
// 'antfu/consistent-list-newline': 'error',
|
|
1114
1191
|
"antfu/import-dedupe": "error",
|
|
1115
|
-
"antfu/no-import-dist": "error",
|
|
1116
1192
|
"antfu/indent-unindent": "error",
|
|
1193
|
+
"antfu/no-import-dist": "error",
|
|
1117
1194
|
"antfu/no-import-node-modules-by-path": "error",
|
|
1118
1195
|
// Overrides rules
|
|
1119
1196
|
...options.overrides
|
|
@@ -1148,34 +1225,19 @@ var configJsdoc = (options = {}) => [
|
|
|
1148
1225
|
// Use `jsdoc/sort-tags`
|
|
1149
1226
|
"jsdoc/text-escaping": "off",
|
|
1150
1227
|
// No need
|
|
1151
|
-
|
|
1152
|
-
"jsdoc/
|
|
1153
|
-
"jsdoc/
|
|
1154
|
-
"jsdoc/
|
|
1155
|
-
"jsdoc/
|
|
1228
|
+
"jsdoc/check-access": "warn",
|
|
1229
|
+
"jsdoc/implements-on-classes": "warn",
|
|
1230
|
+
"jsdoc/require-param-name": "warn",
|
|
1231
|
+
"jsdoc/require-property": "warn",
|
|
1232
|
+
"jsdoc/require-property-description": "warn",
|
|
1233
|
+
"jsdoc/require-property-name": "warn",
|
|
1234
|
+
"jsdoc/require-returns-check": "warn",
|
|
1235
|
+
"jsdoc/require-returns-description": "warn",
|
|
1236
|
+
"jsdoc/require-yields-check": "warn",
|
|
1156
1237
|
"jsdoc/check-alignment": "error",
|
|
1157
|
-
"jsdoc/multiline-blocks": "error",
|
|
1158
|
-
"jsdoc/check-param-names": "error",
|
|
1159
|
-
"jsdoc/no-multi-asterisks": "error",
|
|
1160
1238
|
"jsdoc/check-line-alignment": "error",
|
|
1239
|
+
"jsdoc/check-param-names": "error",
|
|
1161
1240
|
"jsdoc/check-property-names": "error",
|
|
1162
|
-
"jsdoc/require-asterisk-prefix": "error",
|
|
1163
|
-
"jsdoc/no-blank-block-descriptions": "error",
|
|
1164
|
-
"jsdoc/require-hyphen-before-param-description": "error",
|
|
1165
|
-
"jsdoc/no-bad-blocks": [
|
|
1166
|
-
"error",
|
|
1167
|
-
{
|
|
1168
|
-
ignore: [
|
|
1169
|
-
// built-in default
|
|
1170
|
-
"ts-check",
|
|
1171
|
-
"ts-expect-error",
|
|
1172
|
-
"ts-ignore",
|
|
1173
|
-
"ts-nocheck",
|
|
1174
|
-
// useful
|
|
1175
|
-
"vite-ignore"
|
|
1176
|
-
]
|
|
1177
|
-
}
|
|
1178
|
-
],
|
|
1179
1241
|
"jsdoc/check-tag-names": [
|
|
1180
1242
|
"error",
|
|
1181
1243
|
{
|
|
@@ -1196,15 +1258,30 @@ var configJsdoc = (options = {}) => [
|
|
|
1196
1258
|
]
|
|
1197
1259
|
}
|
|
1198
1260
|
],
|
|
1199
|
-
"jsdoc/check-
|
|
1200
|
-
|
|
1201
|
-
"jsdoc/
|
|
1202
|
-
"jsdoc/
|
|
1203
|
-
"jsdoc/
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1261
|
+
"jsdoc/check-types": "error",
|
|
1262
|
+
// Fixable rules
|
|
1263
|
+
"jsdoc/empty-tags": "error",
|
|
1264
|
+
"jsdoc/multiline-blocks": "error",
|
|
1265
|
+
"jsdoc/no-bad-blocks": [
|
|
1266
|
+
"error",
|
|
1267
|
+
{
|
|
1268
|
+
ignore: [
|
|
1269
|
+
// built-in default
|
|
1270
|
+
"ts-check",
|
|
1271
|
+
"ts-expect-error",
|
|
1272
|
+
"ts-ignore",
|
|
1273
|
+
"ts-nocheck",
|
|
1274
|
+
// useful
|
|
1275
|
+
"vite-ignore"
|
|
1276
|
+
]
|
|
1277
|
+
}
|
|
1278
|
+
],
|
|
1279
|
+
"jsdoc/no-blank-block-descriptions": "error",
|
|
1280
|
+
"jsdoc/no-blank-blocks": "error",
|
|
1281
|
+
"jsdoc/no-defaults": "error",
|
|
1282
|
+
"jsdoc/no-multi-asterisks": "error",
|
|
1283
|
+
"jsdoc/require-asterisk-prefix": "error",
|
|
1284
|
+
"jsdoc/require-hyphen-before-param-description": "error",
|
|
1208
1285
|
// TypeScript rules overrides
|
|
1209
1286
|
...options.typescript ? typescriptRules : javscriptRules,
|
|
1210
1287
|
// Overrides rules
|
|
@@ -1226,26 +1303,26 @@ var configJsonc = (options = {}) => [
|
|
|
1226
1303
|
},
|
|
1227
1304
|
rules: {
|
|
1228
1305
|
...default11.configs["recommended-with-jsonc"].rules,
|
|
1229
|
-
"jsonc/no-octal-escape": "error",
|
|
1230
|
-
"jsonc/indent": ["error", 2],
|
|
1231
|
-
"jsonc/comma-style": ["error", "last"],
|
|
1232
|
-
"jsonc/comma-dangle": ["error", "never"],
|
|
1233
|
-
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1234
1306
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1307
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
1308
|
+
"jsonc/comma-style": ["error", "last"],
|
|
1309
|
+
"jsonc/indent": ["error", 2],
|
|
1235
1310
|
"jsonc/key-spacing": [
|
|
1236
1311
|
"error",
|
|
1237
1312
|
{
|
|
1238
|
-
|
|
1239
|
-
|
|
1313
|
+
afterColon: true,
|
|
1314
|
+
beforeColon: false
|
|
1240
1315
|
}
|
|
1241
1316
|
],
|
|
1317
|
+
"jsonc/no-octal-escape": "error",
|
|
1242
1318
|
"jsonc/object-curly-newline": [
|
|
1243
1319
|
"error",
|
|
1244
1320
|
{
|
|
1245
|
-
|
|
1246
|
-
|
|
1321
|
+
consistent: true,
|
|
1322
|
+
multiline: true
|
|
1247
1323
|
}
|
|
1248
1324
|
],
|
|
1325
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1249
1326
|
"jsonc/object-property-newline": [
|
|
1250
1327
|
"error",
|
|
1251
1328
|
{
|
|
@@ -1269,12 +1346,11 @@ var configPinia = (options = {}) => {
|
|
|
1269
1346
|
pinia: default7
|
|
1270
1347
|
},
|
|
1271
1348
|
rules: {
|
|
1272
|
-
"pinia/
|
|
1349
|
+
"pinia/never-export-initialized-store": "error",
|
|
1273
1350
|
"pinia/no-duplicate-store-ids": "error",
|
|
1274
1351
|
"pinia/no-return-global-properties": "error",
|
|
1275
1352
|
"pinia/no-store-to-refs-in-store": "error",
|
|
1276
|
-
"pinia/
|
|
1277
|
-
"pinia/require-setup-store-properties-export": "error",
|
|
1353
|
+
"pinia/prefer-single-store-per-file": "error",
|
|
1278
1354
|
"pinia/prefer-use-store-naming-convention": [
|
|
1279
1355
|
"error",
|
|
1280
1356
|
{
|
|
@@ -1282,6 +1358,7 @@ var configPinia = (options = {}) => {
|
|
|
1282
1358
|
storeSuffix: "Store"
|
|
1283
1359
|
}
|
|
1284
1360
|
],
|
|
1361
|
+
"pinia/require-setup-store-properties-export": "error",
|
|
1285
1362
|
// Overrides rules
|
|
1286
1363
|
...options.overrides
|
|
1287
1364
|
}
|
|
@@ -1379,8 +1456,8 @@ var configUnoCSS = (options = {}) => [
|
|
|
1379
1456
|
unocss: default13
|
|
1380
1457
|
},
|
|
1381
1458
|
rules: {
|
|
1382
|
-
"unocss/order": "error",
|
|
1383
1459
|
"unocss/order-attributify": options.attributify ? "error" : "off",
|
|
1460
|
+
"unocss/order": "error",
|
|
1384
1461
|
// Overrides rules
|
|
1385
1462
|
...options.overrides
|
|
1386
1463
|
}
|
|
@@ -1389,50 +1466,29 @@ var configUnoCSS = (options = {}) => [
|
|
|
1389
1466
|
|
|
1390
1467
|
// src/constants.ts
|
|
1391
1468
|
var DEFAULT_PRETTIER_OPTIONS = {
|
|
1392
|
-
// Include parentheses around a sole arrow function parameter
|
|
1393
1469
|
arrowParens: "avoid",
|
|
1394
|
-
// Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being alone on the next line (does not apply to self closing elements)
|
|
1395
1470
|
bracketSameLine: false,
|
|
1396
|
-
// Print spaces between brackets in object literals.
|
|
1397
1471
|
bracketSpacing: true,
|
|
1398
|
-
// Control whether Prettier formats quoted code embedded in the file
|
|
1399
1472
|
embeddedLanguageFormatting: "auto",
|
|
1400
|
-
// End of line
|
|
1401
1473
|
endOfLine: "lf",
|
|
1402
|
-
|
|
1474
|
+
experimentalOperatorPosition: "start",
|
|
1475
|
+
experimentalTernaries: false,
|
|
1403
1476
|
htmlWhitespaceSensitivity: "css",
|
|
1404
|
-
// Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with prettier.
|
|
1405
1477
|
insertPragma: false,
|
|
1406
|
-
// Use single quotes instead of double quotes in JSX
|
|
1407
1478
|
jsxSingleQuote: true,
|
|
1408
|
-
|
|
1409
|
-
printWidth:
|
|
1410
|
-
// By default, Prettier will wrap markdown text as-is since some services use a line-break-sensitive renderer, e.g. GitHub comment and Bitbucket.
|
|
1479
|
+
objectWrap: "preserve",
|
|
1480
|
+
printWidth: 80,
|
|
1411
1481
|
proseWrap: "preserve",
|
|
1412
|
-
// Change when properties in objects are quoted
|
|
1413
1482
|
quoteProps: "as-needed",
|
|
1414
1483
|
rangeEnd: Number.POSITIVE_INFINITY,
|
|
1415
|
-
// Format only a segment of a file.
|
|
1416
1484
|
rangeStart: 0,
|
|
1417
|
-
// Specify which parser to use.
|
|
1418
|
-
// parser: undefined,
|
|
1419
|
-
// Specify the file name to use to infer which parser to use.
|
|
1420
|
-
// filepath: undefined,
|
|
1421
|
-
// Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file.
|
|
1422
1485
|
requirePragma: false,
|
|
1423
|
-
// Use semicolons or not
|
|
1424
1486
|
semi: false,
|
|
1425
|
-
// Enforce single attribute per line in HTML, Vue and JSX
|
|
1426
1487
|
singleAttributePerLine: true,
|
|
1427
|
-
// Use single quotes instead of double quotes
|
|
1428
1488
|
singleQuote: true,
|
|
1429
|
-
// Specify the number of spaces per indentation-level
|
|
1430
1489
|
tabWidth: 2,
|
|
1431
|
-
// Print trailing commas wherever possible when multi-line
|
|
1432
1490
|
trailingComma: "all",
|
|
1433
|
-
// Indent lines with tabs instead of spaces
|
|
1434
1491
|
useTabs: false,
|
|
1435
|
-
// Whether or not to indent the code inside <script> and <style> tags in Vue files
|
|
1436
1492
|
vueIndentScriptAndStyle: false
|
|
1437
1493
|
};
|
|
1438
1494
|
|
|
@@ -1565,7 +1621,10 @@ var regexper = defineCommand({
|
|
|
1565
1621
|
removeComment: false,
|
|
1566
1622
|
message: "Update the regexper link",
|
|
1567
1623
|
fix(fixer) {
|
|
1568
|
-
return fixer.replaceTextRange(
|
|
1624
|
+
return fixer.replaceTextRange(
|
|
1625
|
+
[indexStart, indexEnd],
|
|
1626
|
+
`@regexper ${url}`
|
|
1627
|
+
);
|
|
1569
1628
|
}
|
|
1570
1629
|
});
|
|
1571
1630
|
}
|
|
@@ -1607,9 +1666,9 @@ var configIgnores = (customIgnores = []) => [
|
|
|
1607
1666
|
// src/configs/importX.ts
|
|
1608
1667
|
var configImportX = (options = {}) => {
|
|
1609
1668
|
const {
|
|
1610
|
-
typescript: enableTypeScript,
|
|
1611
1669
|
// use typescript resolve if possible
|
|
1612
|
-
preferTypeScriptResolver = true
|
|
1670
|
+
preferTypeScriptResolver = true,
|
|
1671
|
+
typescript: enableTypeScript
|
|
1613
1672
|
} = options;
|
|
1614
1673
|
return [
|
|
1615
1674
|
{
|
|
@@ -1620,26 +1679,37 @@ var configImportX = (options = {}) => {
|
|
|
1620
1679
|
settings: {
|
|
1621
1680
|
"import-x/resolver-next": [
|
|
1622
1681
|
enableTypeScript && preferTypeScriptResolver ? createTypeScriptImportResolver({
|
|
1623
|
-
extensions: [
|
|
1682
|
+
extensions: [
|
|
1683
|
+
".ts",
|
|
1684
|
+
".tsx",
|
|
1685
|
+
".d.ts",
|
|
1686
|
+
".js",
|
|
1687
|
+
".jsx",
|
|
1688
|
+
".json",
|
|
1689
|
+
".node"
|
|
1690
|
+
]
|
|
1624
1691
|
}) : createNodeResolver({
|
|
1625
1692
|
extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts", ".json"]
|
|
1626
1693
|
})
|
|
1627
1694
|
]
|
|
1628
1695
|
},
|
|
1629
1696
|
rules: {
|
|
1630
|
-
"import-x/no-unresolved": "off",
|
|
1631
1697
|
"import-x/no-absolute-path": "off",
|
|
1632
1698
|
"import-x/no-named-as-default-member": "off",
|
|
1633
1699
|
"import-x/no-named-default": "off",
|
|
1700
|
+
"import-x/no-unresolved": "off",
|
|
1634
1701
|
// disabled in favor or `perfectionist/sort-imports`
|
|
1635
1702
|
"import-x/order": "off",
|
|
1636
|
-
"import-x/
|
|
1703
|
+
"import-x/consistent-type-specifier-style": [
|
|
1704
|
+
"error",
|
|
1705
|
+
"prefer-top-level"
|
|
1706
|
+
],
|
|
1637
1707
|
"import-x/export": "error",
|
|
1638
|
-
"import-x/
|
|
1708
|
+
"import-x/first": "error",
|
|
1709
|
+
"import-x/newline-after-import": "error",
|
|
1639
1710
|
"import-x/no-duplicates": "error",
|
|
1640
1711
|
"import-x/no-mutable-exports": "error",
|
|
1641
|
-
"import-x/
|
|
1642
|
-
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
1712
|
+
"import-x/no-self-import": "error",
|
|
1643
1713
|
// Overrides rules
|
|
1644
1714
|
...options.overrides
|
|
1645
1715
|
}
|
|
@@ -1651,12 +1721,12 @@ var configImportX = (options = {}) => {
|
|
|
1651
1721
|
var disabledRules2 = {
|
|
1652
1722
|
"unicorn/better-regex": "off",
|
|
1653
1723
|
"unicorn/explicit-length-check": "off",
|
|
1654
|
-
"unicorn/prefer-top-level-await": "off",
|
|
1655
1724
|
"unicorn/no-array-callback-reference": "off",
|
|
1656
1725
|
/**
|
|
1657
1726
|
* @see https://caniuse.com/?search=globalThis
|
|
1658
1727
|
*/
|
|
1659
|
-
"unicorn/prefer-global-this": "off"
|
|
1728
|
+
"unicorn/prefer-global-this": "off",
|
|
1729
|
+
"unicorn/prefer-top-level-await": "off"
|
|
1660
1730
|
};
|
|
1661
1731
|
var configUnicorn = (options = {}) => [
|
|
1662
1732
|
{
|
|
@@ -1665,70 +1735,78 @@ var configUnicorn = (options = {}) => [
|
|
|
1665
1735
|
unicorn: default15
|
|
1666
1736
|
},
|
|
1667
1737
|
rules: {
|
|
1738
|
+
"unicorn/catch-error-name": [
|
|
1739
|
+
"error",
|
|
1740
|
+
{
|
|
1741
|
+
name: "err",
|
|
1742
|
+
ignore: ["^_."]
|
|
1743
|
+
}
|
|
1744
|
+
],
|
|
1745
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
1746
|
+
"unicorn/custom-error-definition": "error",
|
|
1747
|
+
"unicorn/error-message": "error",
|
|
1668
1748
|
"unicorn/escape-case": "error",
|
|
1749
|
+
"unicorn/new-for-builtins": "error",
|
|
1750
|
+
"unicorn/no-console-spaces": "error",
|
|
1669
1751
|
"unicorn/no-for-loop": "error",
|
|
1752
|
+
"unicorn/no-hex-escape": "error",
|
|
1670
1753
|
"unicorn/no-lonely-if": "error",
|
|
1671
|
-
"unicorn/error-message": "error",
|
|
1672
1754
|
"unicorn/no-new-buffer": "error",
|
|
1673
|
-
"unicorn/no-
|
|
1674
|
-
"unicorn/
|
|
1675
|
-
"unicorn/
|
|
1676
|
-
"unicorn/new-for-builtins": "error",
|
|
1677
|
-
"unicorn/prefer-type-error": "error",
|
|
1678
|
-
"unicorn/prefer-math-trunc": "error",
|
|
1679
|
-
"unicorn/no-console-spaces": "error",
|
|
1755
|
+
"unicorn/no-static-only-class": "error",
|
|
1756
|
+
"unicorn/no-typeof-undefined": "error",
|
|
1757
|
+
"unicorn/no-unnecessary-await": "error",
|
|
1680
1758
|
"unicorn/no-zero-fractions": "error",
|
|
1681
|
-
"unicorn/prefer-regexp-test": "error",
|
|
1682
1759
|
"unicorn/number-literal-case": "error",
|
|
1683
|
-
"unicorn/
|
|
1760
|
+
"unicorn/prefer-date-now": "error",
|
|
1761
|
+
"unicorn/prefer-includes": "error",
|
|
1762
|
+
"unicorn/prefer-keyboard-event-key": "error",
|
|
1684
1763
|
"unicorn/prefer-math-min-max": "error",
|
|
1685
|
-
"unicorn/prefer-
|
|
1686
|
-
"unicorn/no-unnecessary-await": "error",
|
|
1687
|
-
"unicorn/no-static-only-class": "error",
|
|
1688
|
-
"unicorn/prefer-reflect-apply": "error",
|
|
1689
|
-
"unicorn/prefer-negative-index": "error",
|
|
1690
|
-
"unicorn/prefer-structured-clone": "error",
|
|
1691
|
-
"unicorn/custom-error-definition": "error",
|
|
1764
|
+
"unicorn/prefer-math-trunc": "error",
|
|
1692
1765
|
"unicorn/prefer-modern-math-apis": "error",
|
|
1766
|
+
"unicorn/prefer-negative-index": "error",
|
|
1767
|
+
"unicorn/prefer-node-protocol": "error",
|
|
1693
1768
|
"unicorn/prefer-number-properties": "error",
|
|
1694
|
-
"unicorn/prefer-prototype-methods": "error",
|
|
1695
|
-
"unicorn/prefer-keyboard-event-key": "error",
|
|
1696
1769
|
"unicorn/prefer-optional-catch-binding": "error",
|
|
1697
|
-
"unicorn/
|
|
1770
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
1771
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
1772
|
+
"unicorn/prefer-regexp-test": "error",
|
|
1773
|
+
"unicorn/prefer-structured-clone": "error",
|
|
1774
|
+
"unicorn/prefer-type-error": "error",
|
|
1698
1775
|
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
1699
|
-
"unicorn/
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
ignore: ["^_."]
|
|
1704
|
-
}
|
|
1705
|
-
],
|
|
1706
|
-
"unicorn/prefer-date-now": "error",
|
|
1707
|
-
// String
|
|
1776
|
+
"unicorn/throw-new-error": "error",
|
|
1777
|
+
/**
|
|
1778
|
+
* @pg String
|
|
1779
|
+
*/
|
|
1708
1780
|
"unicorn/prefer-code-point": "error",
|
|
1709
1781
|
"unicorn/prefer-string-slice": "error",
|
|
1710
|
-
"unicorn/prefer-string-trim-start-end": "error",
|
|
1711
1782
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1783
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
1784
|
+
/**
|
|
1785
|
+
* @pg DOM
|
|
1786
|
+
*/
|
|
1787
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1788
|
+
"unicorn/prefer-add-event-listener": "error",
|
|
1716
1789
|
"unicorn/prefer-dom-node-append": "error",
|
|
1717
1790
|
"unicorn/prefer-dom-node-dataset": "error",
|
|
1718
|
-
"unicorn/prefer-
|
|
1791
|
+
"unicorn/prefer-dom-node-remove": "error",
|
|
1719
1792
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
1720
|
-
"unicorn/
|
|
1721
|
-
|
|
1722
|
-
|
|
1793
|
+
"unicorn/prefer-modern-dom-apis": "error",
|
|
1794
|
+
"unicorn/prefer-query-selector": "error",
|
|
1795
|
+
/**
|
|
1796
|
+
* @pg Array
|
|
1797
|
+
*/
|
|
1798
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
1723
1799
|
"unicorn/no-array-push-push": "error",
|
|
1724
|
-
"unicorn/prefer-array-find": "error",
|
|
1725
|
-
"unicorn/prefer-array-some": "error",
|
|
1726
1800
|
"unicorn/no-instanceof-array": "error",
|
|
1801
|
+
"unicorn/no-new-array": "error",
|
|
1802
|
+
"unicorn/prefer-array-find": "error",
|
|
1727
1803
|
"unicorn/prefer-array-flat-map": "error",
|
|
1728
1804
|
"unicorn/prefer-array-index-of": "error",
|
|
1805
|
+
"unicorn/prefer-array-some": "error",
|
|
1729
1806
|
"unicorn/require-array-join-separator": "error",
|
|
1730
|
-
|
|
1731
|
-
|
|
1807
|
+
/**
|
|
1808
|
+
* @pg Set
|
|
1809
|
+
*/
|
|
1732
1810
|
"unicorn/prefer-set-has": "error",
|
|
1733
1811
|
"unicorn/prefer-set-size": "error",
|
|
1734
1812
|
...disabledRules2,
|
|
@@ -1750,8 +1828,8 @@ var configSpecials = (options = {}) => {
|
|
|
1750
1828
|
name: "ntnyq/specials/scripts",
|
|
1751
1829
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
1752
1830
|
rules: {
|
|
1753
|
-
"no-console": "off",
|
|
1754
1831
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1832
|
+
"no-console": "off",
|
|
1755
1833
|
// Overrides rules
|
|
1756
1834
|
...options.overridesScriptsRules
|
|
1757
1835
|
}
|
|
@@ -1760,8 +1838,8 @@ var configSpecials = (options = {}) => {
|
|
|
1760
1838
|
name: "ntnyq/specials/cli",
|
|
1761
1839
|
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
1762
1840
|
rules: {
|
|
1763
|
-
"no-console": "off",
|
|
1764
1841
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1842
|
+
"no-console": "off",
|
|
1765
1843
|
// Overrides rules
|
|
1766
1844
|
...options.overridesCliRules
|
|
1767
1845
|
}
|
|
@@ -1793,16 +1871,24 @@ var configSpecials = (options = {}) => {
|
|
|
1793
1871
|
perfectionist: default20
|
|
1794
1872
|
},
|
|
1795
1873
|
rules: {
|
|
1796
|
-
"no-console": "off",
|
|
1797
|
-
"import-x/no-default-export": "off",
|
|
1798
1874
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1875
|
+
"import-x/no-default-export": "off",
|
|
1876
|
+
"no-console": "off",
|
|
1799
1877
|
"perfectionist/sort-objects": [
|
|
1800
1878
|
"error",
|
|
1801
1879
|
{
|
|
1802
|
-
|
|
1880
|
+
ignoreCase: true,
|
|
1881
|
+
newlinesBetween: "ignore",
|
|
1803
1882
|
order: "asc",
|
|
1804
1883
|
partitionByComment: true,
|
|
1805
|
-
|
|
1884
|
+
type: "alphabetical",
|
|
1885
|
+
groups: [
|
|
1886
|
+
"property",
|
|
1887
|
+
"multiline-property",
|
|
1888
|
+
"method",
|
|
1889
|
+
"multiline-method",
|
|
1890
|
+
"unknown"
|
|
1891
|
+
]
|
|
1806
1892
|
}
|
|
1807
1893
|
],
|
|
1808
1894
|
...options.overridesConfigFileRules
|
|
@@ -1813,12 +1899,15 @@ var configSpecials = (options = {}) => {
|
|
|
1813
1899
|
const shadcnOptions = resolveSubOptions(options, "shadcnVue");
|
|
1814
1900
|
configs2.push({
|
|
1815
1901
|
name: "ntnyq/specials/shadcn-vue",
|
|
1816
|
-
files: shadcnOptions.files || [
|
|
1902
|
+
files: shadcnOptions.files || [
|
|
1903
|
+
"**/components/ui/**/*.ts",
|
|
1904
|
+
"**/components/ui/**/*.vue"
|
|
1905
|
+
],
|
|
1817
1906
|
rules: {
|
|
1818
|
-
"vue/define-emits-declaration": "off",
|
|
1819
|
-
"import-x/consistent-type-specifier-style": "off",
|
|
1820
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
1821
1907
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
1908
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1909
|
+
"import-x/consistent-type-specifier-style": "off",
|
|
1910
|
+
"vue/define-emits-declaration": "off",
|
|
1822
1911
|
// Overrides rules
|
|
1823
1912
|
...shadcnOptions.overridesRules
|
|
1824
1913
|
}
|
|
@@ -1836,15 +1925,11 @@ var configMarkdown = (options = {}) => {
|
|
|
1836
1925
|
/**
|
|
1837
1926
|
* code block files
|
|
1838
1927
|
*/
|
|
1839
|
-
files = [
|
|
1928
|
+
files = [GLOB_MARKDOWN_CODE],
|
|
1840
1929
|
/**
|
|
1841
1930
|
* other extensions
|
|
1842
1931
|
*/
|
|
1843
|
-
extensions = []
|
|
1844
|
-
/**
|
|
1845
|
-
* disbale type aware linting
|
|
1846
|
-
*/
|
|
1847
|
-
disableTypeAwareLinting = false
|
|
1932
|
+
extensions = []
|
|
1848
1933
|
} = options;
|
|
1849
1934
|
const configs2 = [
|
|
1850
1935
|
/**
|
|
@@ -1875,52 +1960,50 @@ var configMarkdown = (options = {}) => {
|
|
|
1875
1960
|
}
|
|
1876
1961
|
},
|
|
1877
1962
|
{
|
|
1878
|
-
name: "ntnyq/markdown/disabled
|
|
1963
|
+
name: "ntnyq/markdown/disabled",
|
|
1879
1964
|
files: [
|
|
1880
1965
|
...files,
|
|
1881
|
-
//
|
|
1966
|
+
// more nested extensions to disable
|
|
1882
1967
|
...extensions.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
1883
1968
|
],
|
|
1884
1969
|
languageOptions: {
|
|
1885
1970
|
parserOptions: {
|
|
1971
|
+
// type-aware lint related parserOptions
|
|
1972
|
+
project: false,
|
|
1973
|
+
projectService: false,
|
|
1886
1974
|
ecmaFeatures: {
|
|
1887
1975
|
impliedStrict: true
|
|
1888
1976
|
}
|
|
1889
1977
|
}
|
|
1890
1978
|
},
|
|
1891
1979
|
rules: {
|
|
1892
|
-
"
|
|
1980
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
1981
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
|
1982
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
1983
|
+
"@typescript-eslint/no-namespace": "off",
|
|
1984
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
1985
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
1986
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
1987
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1988
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
1989
|
+
"import-x/no-unresolved": "off",
|
|
1893
1990
|
"no-alert": "off",
|
|
1894
1991
|
"no-console": "off",
|
|
1895
|
-
"no-unused-vars": "off",
|
|
1896
|
-
"no-unused-expressions": "off",
|
|
1897
1992
|
"no-restricted-imports": "off",
|
|
1993
|
+
"no-undef": "off",
|
|
1994
|
+
"no-unused-expressions": "off",
|
|
1995
|
+
"no-unused-vars": "off",
|
|
1898
1996
|
"node/prefer-global/buffer": "off",
|
|
1899
1997
|
"node/prefer-global/process": "off",
|
|
1900
|
-
"import-x/no-unresolved": "off",
|
|
1901
1998
|
"unused-imports/no-unused-imports": "off",
|
|
1902
1999
|
"unused-imports/no-unused-vars": "off",
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
"@typescript-eslint/no-namespace": "off",
|
|
1906
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
1907
|
-
"@typescript-eslint/no-require-imports": "off",
|
|
1908
|
-
"@typescript-eslint/no-extraneous-class": "off",
|
|
1909
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
1910
|
-
"@typescript-eslint/no-unused-expressions": "off",
|
|
1911
|
-
"@typescript-eslint/consistent-type-imports": "off",
|
|
2000
|
+
// disable all type-aware rules of @typescript-eslint
|
|
2001
|
+
...configs.disableTypeChecked.rules,
|
|
1912
2002
|
// Overrides rules
|
|
1913
2003
|
...options.overrides
|
|
1914
2004
|
}
|
|
1915
2005
|
}
|
|
1916
2006
|
];
|
|
1917
|
-
if (disableTypeAwareLinting) {
|
|
1918
|
-
configs2.push({
|
|
1919
|
-
...configs.disableTypeChecked,
|
|
1920
|
-
name: "ntnyq/markdown/disable/type-aware",
|
|
1921
|
-
files: [GLOB_MARKDOWN_CODE]
|
|
1922
|
-
});
|
|
1923
|
-
}
|
|
1924
2007
|
return configs2;
|
|
1925
2008
|
};
|
|
1926
2009
|
|
|
@@ -2014,25 +2097,25 @@ import jsConfig from "@eslint/js";
|
|
|
2014
2097
|
import globals2 from "globals";
|
|
2015
2098
|
var strictRules = {
|
|
2016
2099
|
complexity: ["error", { max: 30 }],
|
|
2017
|
-
"max-params": ["error", { max: 5 }],
|
|
2018
2100
|
"max-depth": ["error", { max: 5 }],
|
|
2019
|
-
"max-nested-callbacks": ["error", { max: 10 }],
|
|
2020
2101
|
"max-lines": [
|
|
2021
2102
|
"error",
|
|
2022
2103
|
{
|
|
2023
2104
|
max: 1e3,
|
|
2024
|
-
|
|
2025
|
-
|
|
2105
|
+
skipBlankLines: true,
|
|
2106
|
+
skipComments: true
|
|
2026
2107
|
}
|
|
2027
2108
|
],
|
|
2028
2109
|
"max-lines-per-function": [
|
|
2029
2110
|
"error",
|
|
2030
2111
|
{
|
|
2031
2112
|
max: 200,
|
|
2032
|
-
|
|
2033
|
-
|
|
2113
|
+
skipBlankLines: true,
|
|
2114
|
+
skipComments: true
|
|
2034
2115
|
}
|
|
2035
|
-
]
|
|
2116
|
+
],
|
|
2117
|
+
"max-nested-callbacks": ["error", { max: 10 }],
|
|
2118
|
+
"max-params": ["error", { max: 5 }]
|
|
2036
2119
|
};
|
|
2037
2120
|
var configJavaScript = (options = {}) => [
|
|
2038
2121
|
{
|
|
@@ -2042,38 +2125,50 @@ var configJavaScript = (options = {}) => [
|
|
|
2042
2125
|
{
|
|
2043
2126
|
name: "ntnyq/js/core",
|
|
2044
2127
|
languageOptions: {
|
|
2128
|
+
sourceType: "module",
|
|
2045
2129
|
globals: {
|
|
2046
2130
|
...globals2.browser,
|
|
2047
2131
|
...globals2.es2021,
|
|
2048
2132
|
...globals2.node
|
|
2049
|
-
}
|
|
2050
|
-
sourceType: "module"
|
|
2133
|
+
}
|
|
2051
2134
|
},
|
|
2052
2135
|
rules: {
|
|
2053
|
-
"
|
|
2136
|
+
"consistent-return": "off",
|
|
2054
2137
|
"no-return-assign": "off",
|
|
2055
2138
|
"no-useless-escape": "off",
|
|
2056
|
-
"
|
|
2139
|
+
"require-await": "off",
|
|
2057
2140
|
// disabled in favor of `perfectionist/sort-named-imports`
|
|
2058
2141
|
"sort-imports": "off",
|
|
2059
2142
|
// standard v17.0.0
|
|
2060
|
-
"accessor-pairs": [
|
|
2143
|
+
"accessor-pairs": [
|
|
2144
|
+
"error",
|
|
2145
|
+
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
2146
|
+
],
|
|
2147
|
+
"array-callback-return": "error",
|
|
2148
|
+
"block-scoped-var": "error",
|
|
2061
2149
|
camelcase: [
|
|
2062
2150
|
"error",
|
|
2063
2151
|
{
|
|
2064
2152
|
allow: ["^UNSAFE_"],
|
|
2065
|
-
|
|
2066
|
-
|
|
2153
|
+
ignoreGlobals: true,
|
|
2154
|
+
properties: "never"
|
|
2067
2155
|
}
|
|
2068
2156
|
],
|
|
2069
2157
|
"constructor-super": "error",
|
|
2070
2158
|
curly: ["error", "multi-line"],
|
|
2071
2159
|
"default-case-last": "error",
|
|
2072
2160
|
"dot-notation": ["error", { allowKeywords: true }],
|
|
2073
|
-
|
|
2161
|
+
// best-practice
|
|
2162
|
+
eqeqeq: ["error", "smart"],
|
|
2163
|
+
"new-cap": [
|
|
2164
|
+
"error",
|
|
2165
|
+
{ capIsNew: false, newIsCap: true, properties: true }
|
|
2166
|
+
],
|
|
2167
|
+
"no-alert": "error",
|
|
2074
2168
|
"no-array-constructor": "error",
|
|
2075
2169
|
"no-async-promise-executor": "error",
|
|
2076
2170
|
"no-caller": "error",
|
|
2171
|
+
"no-case-declarations": "error",
|
|
2077
2172
|
"no-class-assign": "error",
|
|
2078
2173
|
"no-compare-neg-zero": "error",
|
|
2079
2174
|
"no-cond-assign": "error",
|
|
@@ -2086,10 +2181,10 @@ var configJavaScript = (options = {}) => [
|
|
|
2086
2181
|
"no-dupe-class-members": "error",
|
|
2087
2182
|
"no-dupe-keys": "error",
|
|
2088
2183
|
"no-duplicate-case": "error",
|
|
2089
|
-
"no-useless-backreference": "error",
|
|
2090
2184
|
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
2091
2185
|
"no-empty-character-class": "error",
|
|
2092
2186
|
"no-empty-pattern": "error",
|
|
2187
|
+
"no-empty-static-block": "error",
|
|
2093
2188
|
"no-eval": "error",
|
|
2094
2189
|
"no-ex-assign": "error",
|
|
2095
2190
|
"no-extend-native": "error",
|
|
@@ -2107,15 +2202,16 @@ var configJavaScript = (options = {}) => [
|
|
|
2107
2202
|
"no-lone-blocks": "error",
|
|
2108
2203
|
"no-loss-of-precision": "error",
|
|
2109
2204
|
"no-misleading-character-class": "error",
|
|
2110
|
-
"no-
|
|
2111
|
-
"no-useless-catch": "error",
|
|
2205
|
+
"no-multi-str": "error",
|
|
2112
2206
|
"no-new": "error",
|
|
2113
2207
|
"no-new-func": "error",
|
|
2208
|
+
"no-new-native-nonconstructor": "error",
|
|
2114
2209
|
"no-new-wrappers": "error",
|
|
2115
2210
|
"no-obj-calls": "error",
|
|
2116
2211
|
"no-octal": "error",
|
|
2117
2212
|
"no-octal-escape": "error",
|
|
2118
2213
|
"no-proto": "error",
|
|
2214
|
+
"no-prototype-builtins": "error",
|
|
2119
2215
|
"no-redeclare": ["error", { builtinGlobals: false }],
|
|
2120
2216
|
"no-regex-spaces": "error",
|
|
2121
2217
|
"no-self-assign": ["error", { props: true }],
|
|
@@ -2139,8 +2235,8 @@ var configJavaScript = (options = {}) => [
|
|
|
2139
2235
|
"error",
|
|
2140
2236
|
{
|
|
2141
2237
|
allowShortCircuit: true,
|
|
2142
|
-
|
|
2143
|
-
|
|
2238
|
+
allowTaggedTemplates: true,
|
|
2239
|
+
allowTernary: true
|
|
2144
2240
|
}
|
|
2145
2241
|
],
|
|
2146
2242
|
"no-unused-vars": [
|
|
@@ -2152,38 +2248,35 @@ var configJavaScript = (options = {}) => [
|
|
|
2152
2248
|
vars: "all"
|
|
2153
2249
|
}
|
|
2154
2250
|
],
|
|
2251
|
+
"no-use-before-define": [
|
|
2252
|
+
"error",
|
|
2253
|
+
{
|
|
2254
|
+
allowNamedExports: false,
|
|
2255
|
+
classes: false,
|
|
2256
|
+
functions: false,
|
|
2257
|
+
variables: true
|
|
2258
|
+
}
|
|
2259
|
+
],
|
|
2260
|
+
"no-useless-backreference": "error",
|
|
2155
2261
|
"no-useless-call": "error",
|
|
2262
|
+
"no-useless-catch": "error",
|
|
2156
2263
|
"no-useless-computed-key": "error",
|
|
2157
2264
|
"no-useless-constructor": "error",
|
|
2158
2265
|
"no-useless-rename": "error",
|
|
2159
2266
|
"no-useless-return": "error",
|
|
2160
|
-
"prefer-promise-reject-errors": "error",
|
|
2161
|
-
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
2162
|
-
"symbol-description": "error",
|
|
2163
|
-
"unicode-bom": ["error", "never"],
|
|
2164
|
-
"use-isnan": [
|
|
2165
|
-
"error",
|
|
2166
|
-
{
|
|
2167
|
-
enforceForSwitchCase: true,
|
|
2168
|
-
enforceForIndexOf: true
|
|
2169
|
-
}
|
|
2170
|
-
],
|
|
2171
|
-
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
2172
|
-
yoda: ["error", "never"],
|
|
2173
2267
|
// es6+
|
|
2174
2268
|
"no-var": "error",
|
|
2175
|
-
"
|
|
2176
|
-
"
|
|
2177
|
-
"
|
|
2178
|
-
"no-empty-static-block": "error",
|
|
2179
|
-
"no-new-native-nonconstructor": "error",
|
|
2180
|
-
"prefer-const": [
|
|
2269
|
+
"no-void": "error",
|
|
2270
|
+
"no-with": "error",
|
|
2271
|
+
"object-shorthand": [
|
|
2181
2272
|
"error",
|
|
2273
|
+
"always",
|
|
2182
2274
|
{
|
|
2183
|
-
|
|
2184
|
-
|
|
2275
|
+
avoidQuotes: true,
|
|
2276
|
+
ignoreConstructors: false
|
|
2185
2277
|
}
|
|
2186
2278
|
],
|
|
2279
|
+
"one-var": ["error", "never"],
|
|
2187
2280
|
"prefer-arrow-callback": [
|
|
2188
2281
|
"error",
|
|
2189
2282
|
{
|
|
@@ -2191,34 +2284,30 @@ var configJavaScript = (options = {}) => [
|
|
|
2191
2284
|
allowUnboundThis: true
|
|
2192
2285
|
}
|
|
2193
2286
|
],
|
|
2194
|
-
"
|
|
2287
|
+
"prefer-const": [
|
|
2195
2288
|
"error",
|
|
2196
|
-
"always",
|
|
2197
2289
|
{
|
|
2198
|
-
|
|
2199
|
-
|
|
2290
|
+
destructuring: "all",
|
|
2291
|
+
ignoreReadBeforeAssign: true
|
|
2200
2292
|
}
|
|
2201
2293
|
],
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
"
|
|
2205
|
-
"
|
|
2206
|
-
"
|
|
2207
|
-
"
|
|
2208
|
-
"
|
|
2209
|
-
"
|
|
2210
|
-
"no-void": "error",
|
|
2211
|
-
"vars-on-top": "error",
|
|
2212
|
-
"one-var": ["error", "never"],
|
|
2213
|
-
"no-use-before-define": [
|
|
2294
|
+
"prefer-promise-reject-errors": "error",
|
|
2295
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
2296
|
+
"prefer-rest-params": "error",
|
|
2297
|
+
"prefer-spread": "error",
|
|
2298
|
+
"prefer-template": "error",
|
|
2299
|
+
"symbol-description": "error",
|
|
2300
|
+
"unicode-bom": ["error", "never"],
|
|
2301
|
+
"use-isnan": [
|
|
2214
2302
|
"error",
|
|
2215
2303
|
{
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
variables: true,
|
|
2219
|
-
allowNamedExports: false
|
|
2304
|
+
enforceForIndexOf: true,
|
|
2305
|
+
enforceForSwitchCase: true
|
|
2220
2306
|
}
|
|
2221
2307
|
],
|
|
2308
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
2309
|
+
"vars-on-top": "error",
|
|
2310
|
+
yoda: ["error", "never"],
|
|
2222
2311
|
// Strict rules
|
|
2223
2312
|
...options.strict ? strictRules : {},
|
|
2224
2313
|
// Overrides rules
|
|
@@ -2243,40 +2332,43 @@ var configJSX = () => [
|
|
|
2243
2332
|
// src/configs/typescript.ts
|
|
2244
2333
|
import process4 from "node:process";
|
|
2245
2334
|
var typeAwareRules = {
|
|
2335
|
+
// too strict
|
|
2336
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
2246
2337
|
"dot-notation": "off",
|
|
2247
|
-
"require-await": "off",
|
|
2248
2338
|
"no-implied-eval": "off",
|
|
2249
2339
|
"no-throw-literal": "off",
|
|
2250
|
-
|
|
2251
|
-
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
2252
|
-
"@typescript-eslint/require-await": "error",
|
|
2253
|
-
"@typescript-eslint/unbound-method": "error",
|
|
2254
|
-
"@typescript-eslint/no-unsafe-call": "error",
|
|
2340
|
+
"require-await": "off",
|
|
2255
2341
|
"@typescript-eslint/await-thenable": "error",
|
|
2342
|
+
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
2343
|
+
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
2344
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
2256
2345
|
"@typescript-eslint/no-for-in-array": "error",
|
|
2257
2346
|
"@typescript-eslint/no-implied-eval": "error",
|
|
2258
|
-
"@typescript-eslint/
|
|
2259
|
-
"@typescript-eslint/no-unsafe-return": "error",
|
|
2347
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
2260
2348
|
"@typescript-eslint/no-misused-spread": "error",
|
|
2349
|
+
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
2350
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
2261
2351
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
2262
|
-
"@typescript-eslint/no-misused-promises": "error",
|
|
2263
2352
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
2264
|
-
"@typescript-eslint/no-
|
|
2353
|
+
"@typescript-eslint/no-unsafe-call": "error",
|
|
2354
|
+
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
2355
|
+
"@typescript-eslint/no-unsafe-return": "error",
|
|
2356
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
2265
2357
|
"@typescript-eslint/promise-function-async": "error",
|
|
2358
|
+
"@typescript-eslint/require-await": "error",
|
|
2266
2359
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
2267
|
-
"@typescript-eslint/triple-slash-reference": "error",
|
|
2268
|
-
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
2269
|
-
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
2270
|
-
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
2271
2360
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
2272
|
-
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
2273
|
-
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
2274
2361
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
2275
|
-
"@typescript-eslint/
|
|
2362
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
2363
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
2364
|
+
"@typescript-eslint/unbound-method": "error"
|
|
2276
2365
|
};
|
|
2277
|
-
var recommendedRules = configs.recommended.reduce(
|
|
2278
|
-
|
|
2279
|
-
|
|
2366
|
+
var recommendedRules = configs.recommended.reduce(
|
|
2367
|
+
(rules, config) => {
|
|
2368
|
+
return { ...rules, ...config.rules || {} };
|
|
2369
|
+
},
|
|
2370
|
+
{}
|
|
2371
|
+
);
|
|
2280
2372
|
var configTypeScript = (options = {}) => {
|
|
2281
2373
|
const enableTypeAwareLint = !!options?.tsconfigPath;
|
|
2282
2374
|
const {
|
|
@@ -2297,11 +2389,11 @@ var configTypeScript = (options = {}) => {
|
|
|
2297
2389
|
extraFileExtensions: extensions.map((ext) => `.${ext}`),
|
|
2298
2390
|
sourceType: "module",
|
|
2299
2391
|
...enableTypeAware ? {
|
|
2392
|
+
tsconfigRootDir: process4.cwd(),
|
|
2300
2393
|
projectService: {
|
|
2301
2394
|
allowDefaultProject: ["./*.js"],
|
|
2302
2395
|
defaultProject: options.tsconfigPath
|
|
2303
|
-
}
|
|
2304
|
-
tsconfigRootDir: process4.cwd()
|
|
2396
|
+
}
|
|
2305
2397
|
} : {},
|
|
2306
2398
|
...parserOptions
|
|
2307
2399
|
};
|
|
@@ -2333,100 +2425,103 @@ var configTypeScript = (options = {}) => {
|
|
|
2333
2425
|
files,
|
|
2334
2426
|
rules: {
|
|
2335
2427
|
...recommendedRules,
|
|
2336
|
-
"@typescript-eslint/
|
|
2337
|
-
"@typescript-eslint/
|
|
2428
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
2429
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
2430
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
2431
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
2338
2432
|
"@typescript-eslint/naming-convention": "off",
|
|
2339
2433
|
"@typescript-eslint/no-empty-function": "off",
|
|
2434
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
2435
|
+
"@typescript-eslint/no-namespace": "off",
|
|
2340
2436
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
2341
2437
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
2342
|
-
"
|
|
2343
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
2344
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
2345
|
-
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
2346
|
-
"@typescript-eslint/prefer-as-const": "warn",
|
|
2438
|
+
"default-param-last": "off",
|
|
2347
2439
|
// Disabled in favor of enhanced ts rules
|
|
2348
2440
|
"no-redeclare": "off",
|
|
2349
2441
|
"no-unused-vars": "off",
|
|
2350
|
-
"default-param-last": "off",
|
|
2351
2442
|
"no-use-before-define": "off",
|
|
2352
2443
|
"no-useless-constructor": "off",
|
|
2353
|
-
"@typescript-eslint/
|
|
2354
|
-
"@typescript-eslint/
|
|
2355
|
-
"@typescript-eslint/no-redeclare": [
|
|
2444
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
2445
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
2356
2446
|
"error",
|
|
2357
2447
|
{
|
|
2358
|
-
|
|
2359
|
-
|
|
2448
|
+
minimumDescriptionLength: 1,
|
|
2449
|
+
"ts-check": false,
|
|
2450
|
+
"ts-expect-error": "allow-with-description",
|
|
2451
|
+
"ts-ignore": "allow-with-description",
|
|
2452
|
+
"ts-nocheck": "allow-with-description"
|
|
2360
2453
|
}
|
|
2361
2454
|
],
|
|
2362
|
-
|
|
2455
|
+
// Extra rules
|
|
2456
|
+
"@typescript-eslint/ban-tslint-comment": "error",
|
|
2457
|
+
"@typescript-eslint/consistent-generic-constructors": [
|
|
2458
|
+
"error",
|
|
2459
|
+
"constructor"
|
|
2460
|
+
],
|
|
2461
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
2363
2462
|
"error",
|
|
2364
2463
|
{
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
variables: true,
|
|
2368
|
-
allowNamedExports: false,
|
|
2369
|
-
enums: true,
|
|
2370
|
-
typedefs: false,
|
|
2371
|
-
ignoreTypeReferences: false
|
|
2464
|
+
assertionStyle: "as",
|
|
2465
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
2372
2466
|
}
|
|
2373
2467
|
],
|
|
2374
|
-
"@typescript-eslint/
|
|
2468
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
2375
2469
|
"error",
|
|
2376
2470
|
{
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
caughtErrors: "all",
|
|
2381
|
-
caughtErrorsIgnorePattern: "^_",
|
|
2382
|
-
destructuredArrayIgnorePattern: "^_",
|
|
2383
|
-
varsIgnorePattern: "^_",
|
|
2384
|
-
ignoreRestSiblings: true
|
|
2471
|
+
disallowTypeAnnotations: false,
|
|
2472
|
+
fixStyle: "separate-type-imports",
|
|
2473
|
+
prefer: "type-imports"
|
|
2385
2474
|
}
|
|
2386
2475
|
],
|
|
2387
|
-
|
|
2388
|
-
"@typescript-eslint/
|
|
2389
|
-
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
|
2390
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
2476
|
+
"@typescript-eslint/default-param-last": "error",
|
|
2477
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
2391
2478
|
"error",
|
|
2392
2479
|
{
|
|
2393
|
-
|
|
2394
|
-
"
|
|
2395
|
-
"ts-expect-error": "allow-with-description",
|
|
2396
|
-
"ts-ignore": "allow-with-description",
|
|
2397
|
-
"ts-nocheck": "allow-with-description"
|
|
2480
|
+
allowInterfaces: "always",
|
|
2481
|
+
allowObjectTypes: "always"
|
|
2398
2482
|
}
|
|
2399
2483
|
],
|
|
2400
|
-
"@typescript-eslint/no-
|
|
2484
|
+
"@typescript-eslint/no-redeclare": [
|
|
2401
2485
|
"error",
|
|
2402
2486
|
{
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
allowTaggedTemplates: true
|
|
2487
|
+
builtinGlobals: false,
|
|
2488
|
+
ignoreDeclarationMerge: true
|
|
2406
2489
|
}
|
|
2407
2490
|
],
|
|
2408
|
-
"@typescript-eslint/
|
|
2491
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
2409
2492
|
"error",
|
|
2410
2493
|
{
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2494
|
+
allowShortCircuit: true,
|
|
2495
|
+
allowTaggedTemplates: true,
|
|
2496
|
+
allowTernary: true
|
|
2414
2497
|
}
|
|
2415
2498
|
],
|
|
2416
|
-
"@typescript-eslint/no-
|
|
2499
|
+
"@typescript-eslint/no-unused-vars": [
|
|
2417
2500
|
"error",
|
|
2418
2501
|
{
|
|
2419
|
-
|
|
2420
|
-
|
|
2502
|
+
// Args after the last used will be reported
|
|
2503
|
+
args: "after-used",
|
|
2504
|
+
argsIgnorePattern: "^_",
|
|
2505
|
+
caughtErrors: "all",
|
|
2506
|
+
caughtErrorsIgnorePattern: "^_",
|
|
2507
|
+
destructuredArrayIgnorePattern: "^_",
|
|
2508
|
+
ignoreRestSiblings: true,
|
|
2509
|
+
varsIgnorePattern: "^_"
|
|
2421
2510
|
}
|
|
2422
2511
|
],
|
|
2423
|
-
"@typescript-eslint/
|
|
2512
|
+
"@typescript-eslint/no-use-before-define": [
|
|
2424
2513
|
"error",
|
|
2425
2514
|
{
|
|
2426
|
-
|
|
2427
|
-
|
|
2515
|
+
allowNamedExports: false,
|
|
2516
|
+
classes: false,
|
|
2517
|
+
enums: true,
|
|
2518
|
+
functions: false,
|
|
2519
|
+
ignoreTypeReferences: false,
|
|
2520
|
+
typedefs: false,
|
|
2521
|
+
variables: true
|
|
2428
2522
|
}
|
|
2429
2523
|
],
|
|
2524
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
2430
2525
|
// Overrides rules
|
|
2431
2526
|
...options.overrides
|
|
2432
2527
|
}
|
|
@@ -2447,11 +2542,11 @@ var configTypeScript = (options = {}) => {
|
|
|
2447
2542
|
name: "ntnyq/ts/types",
|
|
2448
2543
|
files: [...GLOB_TYPES],
|
|
2449
2544
|
rules: {
|
|
2450
|
-
"no-use-before-define": "off",
|
|
2451
|
-
"no-restricted-syntax": "off",
|
|
2452
|
-
"import-x/no-duplicates": "off",
|
|
2545
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
2453
2546
|
"import-x/newline-after-import": "off",
|
|
2454
|
-
"
|
|
2547
|
+
"import-x/no-duplicates": "off",
|
|
2548
|
+
"no-restricted-syntax": "off",
|
|
2549
|
+
"no-use-before-define": "off"
|
|
2455
2550
|
}
|
|
2456
2551
|
}
|
|
2457
2552
|
];
|
|
@@ -2460,7 +2555,9 @@ var configTypeScript = (options = {}) => {
|
|
|
2460
2555
|
// src/configs/eslintPlugin.ts
|
|
2461
2556
|
var configESLintPlugin = async (options = {}) => {
|
|
2462
2557
|
await ensurePackages(["eslint-plugin-eslint-plugin"]);
|
|
2463
|
-
const pluginESLintPlugin = await interopDefault(
|
|
2558
|
+
const pluginESLintPlugin = await interopDefault(
|
|
2559
|
+
import("eslint-plugin-eslint-plugin")
|
|
2560
|
+
);
|
|
2464
2561
|
return [
|
|
2465
2562
|
{
|
|
2466
2563
|
...pluginESLintPlugin.configs["flat/all"],
|
|
@@ -2480,19 +2577,20 @@ var configESLintPlugin = async (options = {}) => {
|
|
|
2480
2577
|
import { createConfig } from "eslint-plugin-github-action";
|
|
2481
2578
|
var configGitHubAction = (options = {}) => {
|
|
2482
2579
|
const {
|
|
2483
|
-
|
|
2580
|
+
files = [GLOB_GITHUB_ACTION],
|
|
2581
|
+
rules = {},
|
|
2484
2582
|
overrides: overridesRules = {},
|
|
2485
|
-
// Config options
|
|
2486
2583
|
...restOptions
|
|
2487
2584
|
} = options;
|
|
2488
2585
|
return [
|
|
2489
2586
|
createConfig({
|
|
2490
2587
|
name: "ntnyq/github-action",
|
|
2491
|
-
files
|
|
2588
|
+
files,
|
|
2492
2589
|
rules: {
|
|
2493
2590
|
"github-action/no-invalid-key": "error",
|
|
2494
2591
|
"github-action/prefer-file-extension": "error",
|
|
2495
2592
|
"github-action/require-action-name": "error",
|
|
2593
|
+
...rules,
|
|
2496
2594
|
...overridesRules
|
|
2497
2595
|
},
|
|
2498
2596
|
...restOptions
|
|
@@ -2566,16 +2664,16 @@ var INTERSECTION_OR_UNION_TYPES_GROUPS = [
|
|
|
2566
2664
|
];
|
|
2567
2665
|
var configPerfectionist = (options = {}) => {
|
|
2568
2666
|
const {
|
|
2569
|
-
|
|
2570
|
-
sortTypes: enableSortTypes = true,
|
|
2667
|
+
partitionByComment = ["@pg", "@perfectionist-group"],
|
|
2571
2668
|
sortConstants: enableSortConstants = true,
|
|
2572
|
-
|
|
2669
|
+
sortEnums: enableSortEnums = true,
|
|
2670
|
+
sortTypes: enableSortTypes = true
|
|
2573
2671
|
} = options;
|
|
2574
2672
|
function getCommonRuleOptions(options2 = {}) {
|
|
2575
2673
|
const ruleOptions = {
|
|
2576
|
-
type: "alphabetical",
|
|
2577
|
-
order: "asc",
|
|
2578
2674
|
ignoreCase: true,
|
|
2675
|
+
order: "asc",
|
|
2676
|
+
type: "alphabetical",
|
|
2579
2677
|
...options2.disableNewlinesBetween ? {} : { newlinesBetween: "ignore" },
|
|
2580
2678
|
...options2.disableNewlinesBetween ? {} : { partitionByComment }
|
|
2581
2679
|
};
|
|
@@ -2588,10 +2686,21 @@ var configPerfectionist = (options = {}) => {
|
|
|
2588
2686
|
perfectionist: default20
|
|
2589
2687
|
},
|
|
2590
2688
|
rules: {
|
|
2689
|
+
"perfectionist/sort-exports": [
|
|
2690
|
+
"error",
|
|
2691
|
+
{
|
|
2692
|
+
...getCommonRuleOptions({
|
|
2693
|
+
disableNewlinesBetween: true
|
|
2694
|
+
}),
|
|
2695
|
+
groupKind: "values-first",
|
|
2696
|
+
type: "line-length"
|
|
2697
|
+
}
|
|
2698
|
+
],
|
|
2591
2699
|
"perfectionist/sort-imports": [
|
|
2592
2700
|
"error",
|
|
2593
2701
|
{
|
|
2594
2702
|
...getCommonRuleOptions(),
|
|
2703
|
+
internalPattern: ["^~/.+", "^@/.+", "^#.+"],
|
|
2595
2704
|
groups: [
|
|
2596
2705
|
// Side effect style imports (e.g. 'normalize.css')
|
|
2597
2706
|
"side-effect-style",
|
|
@@ -2627,18 +2736,7 @@ var configPerfectionist = (options = {}) => {
|
|
|
2627
2736
|
* Imports that don’t fit into any other group
|
|
2628
2737
|
*/
|
|
2629
2738
|
"unknown"
|
|
2630
|
-
]
|
|
2631
|
-
internalPattern: ["^~/.+", "^@/.+", "^#.+"]
|
|
2632
|
-
}
|
|
2633
|
-
],
|
|
2634
|
-
"perfectionist/sort-exports": [
|
|
2635
|
-
"error",
|
|
2636
|
-
{
|
|
2637
|
-
...getCommonRuleOptions({
|
|
2638
|
-
disableNewlinesBetween: true
|
|
2639
|
-
}),
|
|
2640
|
-
type: "line-length",
|
|
2641
|
-
groupKind: "values-first"
|
|
2739
|
+
]
|
|
2642
2740
|
}
|
|
2643
2741
|
],
|
|
2644
2742
|
"perfectionist/sort-named-exports": [
|
|
@@ -2647,8 +2745,8 @@ var configPerfectionist = (options = {}) => {
|
|
|
2647
2745
|
...getCommonRuleOptions({
|
|
2648
2746
|
disableNewlinesBetween: true
|
|
2649
2747
|
}),
|
|
2650
|
-
|
|
2651
|
-
|
|
2748
|
+
groupKind: "values-first",
|
|
2749
|
+
ignoreAlias: false
|
|
2652
2750
|
}
|
|
2653
2751
|
],
|
|
2654
2752
|
"perfectionist/sort-named-imports": [
|
|
@@ -2657,8 +2755,8 @@ var configPerfectionist = (options = {}) => {
|
|
|
2657
2755
|
...getCommonRuleOptions({
|
|
2658
2756
|
disableNewlinesBetween: true
|
|
2659
2757
|
}),
|
|
2660
|
-
|
|
2661
|
-
|
|
2758
|
+
groupKind: "values-first",
|
|
2759
|
+
ignoreAlias: false
|
|
2662
2760
|
}
|
|
2663
2761
|
],
|
|
2664
2762
|
// Overrides rules
|
|
@@ -2761,20 +2859,26 @@ var configPerfectionist = (options = {}) => {
|
|
|
2761
2859
|
...getCommonRuleOptions()
|
|
2762
2860
|
}
|
|
2763
2861
|
],
|
|
2764
|
-
"perfectionist/sort-
|
|
2862
|
+
"perfectionist/sort-modules": [
|
|
2765
2863
|
"error",
|
|
2766
2864
|
{
|
|
2767
|
-
...getCommonRuleOptions()
|
|
2768
|
-
groups: ["property", "multiline-property", "method", "multiline-method", "unknown"]
|
|
2865
|
+
...getCommonRuleOptions()
|
|
2769
2866
|
}
|
|
2770
2867
|
],
|
|
2771
|
-
"perfectionist/sort-
|
|
2868
|
+
"perfectionist/sort-objects": [
|
|
2772
2869
|
"error",
|
|
2773
2870
|
{
|
|
2774
|
-
...getCommonRuleOptions()
|
|
2871
|
+
...getCommonRuleOptions(),
|
|
2872
|
+
groups: [
|
|
2873
|
+
"property",
|
|
2874
|
+
"multiline-property",
|
|
2875
|
+
"method",
|
|
2876
|
+
"multiline-method",
|
|
2877
|
+
"unknown"
|
|
2878
|
+
]
|
|
2775
2879
|
}
|
|
2776
2880
|
],
|
|
2777
|
-
"perfectionist/sort-
|
|
2881
|
+
"perfectionist/sort-sets": [
|
|
2778
2882
|
"error",
|
|
2779
2883
|
{
|
|
2780
2884
|
...getCommonRuleOptions()
|
|
@@ -2801,14 +2905,14 @@ var configUnusedImports = (options = {}) => [
|
|
|
2801
2905
|
"unused-imports/no-unused-vars": [
|
|
2802
2906
|
"error",
|
|
2803
2907
|
{
|
|
2804
|
-
vars: "all",
|
|
2805
|
-
varsIgnorePattern: "^_",
|
|
2806
2908
|
args: "after-used",
|
|
2807
2909
|
argsIgnorePattern: "^_",
|
|
2808
|
-
ignoreRestSiblings: true,
|
|
2809
|
-
destructuredArrayIgnorePattern: "^_",
|
|
2810
2910
|
caughtErrors: "all",
|
|
2811
|
-
caughtErrorsIgnorePattern: "^_"
|
|
2911
|
+
caughtErrorsIgnorePattern: "^_",
|
|
2912
|
+
destructuredArrayIgnorePattern: "^_",
|
|
2913
|
+
ignoreRestSiblings: true,
|
|
2914
|
+
vars: "all",
|
|
2915
|
+
varsIgnorePattern: "^_"
|
|
2812
2916
|
}
|
|
2813
2917
|
],
|
|
2814
2918
|
// Overrides rules
|
|
@@ -2826,7 +2930,10 @@ var configESLintComments = (options = {}) => [
|
|
|
2826
2930
|
},
|
|
2827
2931
|
rules: {
|
|
2828
2932
|
...default22.configs.recommended.rules,
|
|
2829
|
-
"@eslint-community/eslint-comments/disable-enable-pair": [
|
|
2933
|
+
"@eslint-community/eslint-comments/disable-enable-pair": [
|
|
2934
|
+
"error",
|
|
2935
|
+
{ allowWholeFile: true }
|
|
2936
|
+
],
|
|
2830
2937
|
// Overrides rules
|
|
2831
2938
|
...options.overrides
|
|
2832
2939
|
}
|