@ntnyq/eslint-config 3.1.2 → 3.2.1
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/README.md +2 -2
- package/dist/index.cjs +158 -122
- package/dist/index.d.cts +70 -50
- package/dist/index.d.ts +70 -50
- package/dist/index.js +158 -122
- package/package.json +19 -20
package/README.md
CHANGED
|
@@ -87,12 +87,12 @@ pnpm add husky nano-staged -D
|
|
|
87
87
|
"prepare": "husky"
|
|
88
88
|
},
|
|
89
89
|
"nano-staged": {
|
|
90
|
-
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,yml,yaml
|
|
90
|
+
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,html,json,toml,yml,yaml}": "eslint --fix"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
### 3. Add a
|
|
95
|
+
### 3. Add a Git hook
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
98
|
echo "nano-staged" > .husky/pre-commit
|
package/dist/index.cjs
CHANGED
|
@@ -379,6 +379,129 @@ var vue3Rules = {
|
|
|
379
379
|
...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
|
|
380
380
|
...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
|
|
381
381
|
};
|
|
382
|
+
var disabledRules = {
|
|
383
|
+
"vue/no-v-html": "off",
|
|
384
|
+
"vue/require-prop-types": "off",
|
|
385
|
+
"vue/require-default-prop": "off",
|
|
386
|
+
"vue/multi-word-component-names": "off",
|
|
387
|
+
"vue/no-v-text-v-html-on-component": "off",
|
|
388
|
+
"vue/no-setup-props-reactivity-loss": "off"
|
|
389
|
+
};
|
|
390
|
+
var extensionRules = {
|
|
391
|
+
"vue/prefer-template": "error",
|
|
392
|
+
"vue/no-sparse-arrays": "error",
|
|
393
|
+
"vue/no-empty-pattern": "error",
|
|
394
|
+
"vue/space-infix-ops": "error",
|
|
395
|
+
"vue/no-loss-of-precision": "error",
|
|
396
|
+
"vue/no-constant-condition": "error",
|
|
397
|
+
"vue/template-curly-spacing": "error",
|
|
398
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
399
|
+
"vue/comma-style": ["error", "last"],
|
|
400
|
+
"vue/block-spacing": ["error", "always"],
|
|
401
|
+
"vue/dot-location": ["error", "property"],
|
|
402
|
+
"vue/space-in-parens": ["error", "never"],
|
|
403
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
404
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
405
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
406
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
407
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
408
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
409
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
410
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
411
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
412
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
413
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
414
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
415
|
+
"vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
|
|
416
|
+
"vue/space-unary-ops": [
|
|
417
|
+
"error",
|
|
418
|
+
{
|
|
419
|
+
words: true,
|
|
420
|
+
nonwords: false
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"vue/object-curly-newline": [
|
|
424
|
+
"error",
|
|
425
|
+
{
|
|
426
|
+
multiline: true,
|
|
427
|
+
consistent: true
|
|
428
|
+
}
|
|
429
|
+
],
|
|
430
|
+
"vue/object-property-newline": [
|
|
431
|
+
"error",
|
|
432
|
+
{
|
|
433
|
+
allowMultiplePropertiesPerLine: true
|
|
434
|
+
}
|
|
435
|
+
],
|
|
436
|
+
"vue/object-shorthand": [
|
|
437
|
+
"error",
|
|
438
|
+
"always",
|
|
439
|
+
{
|
|
440
|
+
ignoreConstructors: false,
|
|
441
|
+
avoidQuotes: true
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
};
|
|
445
|
+
var unCategorizedRules = {
|
|
446
|
+
"vue/no-useless-v-bind": "error",
|
|
447
|
+
"vue/valid-define-options": "error",
|
|
448
|
+
"vue/prefer-define-options": "error",
|
|
449
|
+
"vue/no-irregular-whitespace": "error",
|
|
450
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
451
|
+
"vue/no-deprecated-delete-set": "error",
|
|
452
|
+
"vue/require-typed-object-prop": "error",
|
|
453
|
+
"vue/no-unused-emit-declarations": "error",
|
|
454
|
+
"vue/padding-line-between-blocks": "error",
|
|
455
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
456
|
+
"vue/prefer-separate-static-class": "error",
|
|
457
|
+
"vue/next-tick-style": ["error", "promise"],
|
|
458
|
+
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
459
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
460
|
+
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
461
|
+
"vue/prefer-true-attribute-shorthand": ["error", "always"],
|
|
462
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
463
|
+
"vue/block-order": [
|
|
464
|
+
"error",
|
|
465
|
+
{
|
|
466
|
+
order: ["script", "template", "style"]
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"vue/no-static-inline-styles": [
|
|
470
|
+
"error",
|
|
471
|
+
{
|
|
472
|
+
allowBinding: true
|
|
473
|
+
}
|
|
474
|
+
],
|
|
475
|
+
"vue/no-deprecated-model-definition": [
|
|
476
|
+
"error",
|
|
477
|
+
{
|
|
478
|
+
allowVue3Compat: true
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
"vue/component-name-in-template-casing": [
|
|
482
|
+
"error",
|
|
483
|
+
"PascalCase",
|
|
484
|
+
{
|
|
485
|
+
// Force auto-import components to be PascalCase
|
|
486
|
+
registeredComponentsOnly: false,
|
|
487
|
+
ignores: ["slot", "component"]
|
|
488
|
+
}
|
|
489
|
+
],
|
|
490
|
+
"vue/define-macros-order": [
|
|
491
|
+
"error",
|
|
492
|
+
{
|
|
493
|
+
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots", "defineModel"],
|
|
494
|
+
defineExposeLast: true
|
|
495
|
+
}
|
|
496
|
+
],
|
|
497
|
+
"vue/html-comment-content-spacing": [
|
|
498
|
+
"error",
|
|
499
|
+
"always",
|
|
500
|
+
{
|
|
501
|
+
exceptions: ["-"]
|
|
502
|
+
}
|
|
503
|
+
]
|
|
504
|
+
};
|
|
382
505
|
var vue = (options = {}) => {
|
|
383
506
|
const isVue3 = options.vueVersion !== 2;
|
|
384
507
|
return [
|
|
@@ -408,13 +531,6 @@ var vue = (options = {}) => {
|
|
|
408
531
|
processor: import_eslint_plugin_vue.default.processors[".vue"],
|
|
409
532
|
rules: {
|
|
410
533
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
411
|
-
// OFF
|
|
412
|
-
"vue/no-v-html": "off",
|
|
413
|
-
"vue/require-prop-types": "off",
|
|
414
|
-
"vue/require-default-prop": "off",
|
|
415
|
-
"vue/multi-word-component-names": "off",
|
|
416
|
-
"vue/no-v-text-v-html-on-component": "off",
|
|
417
|
-
"vue/no-setup-props-reactivity-loss": "off",
|
|
418
534
|
"vue/html-self-closing": [
|
|
419
535
|
"error",
|
|
420
536
|
{
|
|
@@ -434,123 +550,8 @@ var vue = (options = {}) => {
|
|
|
434
550
|
multiline: "always"
|
|
435
551
|
}
|
|
436
552
|
],
|
|
437
|
-
"vue/component-name-in-template-casing": [
|
|
438
|
-
"error",
|
|
439
|
-
"PascalCase",
|
|
440
|
-
{
|
|
441
|
-
// Force auto-import components to be PascalCase
|
|
442
|
-
registeredComponentsOnly: false,
|
|
443
|
-
ignores: ["slot", "component"]
|
|
444
|
-
}
|
|
445
|
-
],
|
|
446
|
-
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
447
|
-
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
448
|
-
"vue/define-macros-order": [
|
|
449
|
-
"error",
|
|
450
|
-
{
|
|
451
|
-
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
|
|
452
|
-
}
|
|
453
|
-
],
|
|
454
|
-
"vue/html-comment-content-spacing": [
|
|
455
|
-
"error",
|
|
456
|
-
"always",
|
|
457
|
-
{
|
|
458
|
-
exceptions: ["-"]
|
|
459
|
-
}
|
|
460
|
-
],
|
|
461
|
-
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
462
|
-
"vue/no-useless-v-bind": "error",
|
|
463
|
-
"vue/padding-line-between-blocks": "error",
|
|
464
|
-
"vue/next-tick-style": ["error", "promise"],
|
|
465
|
-
"vue/array-bracket-spacing": ["error", "never"],
|
|
466
|
-
"vue/prefer-separate-static-class": "error",
|
|
467
|
-
"vue/no-constant-condition": "error",
|
|
468
|
-
"vue/prefer-true-attribute-shorthand": ["error", "always"],
|
|
469
|
-
"vue/prefer-define-options": "error",
|
|
470
|
-
"vue/valid-define-options": "error",
|
|
471
|
-
// TypeScript enhancements
|
|
472
|
-
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
473
|
-
"vue/no-unused-emit-declarations": "error",
|
|
474
553
|
"vue/this-in-template": ["error", "never"],
|
|
475
|
-
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
476
|
-
"vue/block-spacing": ["error", "always"],
|
|
477
|
-
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
478
|
-
"vue/comma-dangle": ["error", "always-multiline"],
|
|
479
|
-
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
480
|
-
"vue/comma-style": ["error", "last"],
|
|
481
|
-
"vue/dot-location": ["error", "property"],
|
|
482
|
-
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
483
|
-
"vue/eqeqeq": ["error", "smart"],
|
|
484
|
-
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
485
|
-
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
486
|
-
"vue/no-empty-pattern": "error",
|
|
487
|
-
"vue/no-loss-of-precision": "error",
|
|
488
|
-
"vue/no-irregular-whitespace": "error",
|
|
489
|
-
"vue/no-use-v-else-with-v-for": "error",
|
|
490
|
-
"vue/require-typed-object-prop": "error",
|
|
491
|
-
"vue/no-deprecated-delete-set": "error",
|
|
492
|
-
"vue/no-extra-parens": ["error", "functions"],
|
|
493
|
-
"vue/no-restricted-syntax": [
|
|
494
|
-
"error",
|
|
495
|
-
"DebuggerStatement",
|
|
496
|
-
"LabeledStatement",
|
|
497
|
-
"WithStatement"
|
|
498
|
-
],
|
|
499
|
-
"vue/no-sparse-arrays": "error",
|
|
500
|
-
"vue/no-deprecated-model-definition": [
|
|
501
|
-
"error",
|
|
502
|
-
{
|
|
503
|
-
allowVue3Compat: true
|
|
504
|
-
}
|
|
505
|
-
],
|
|
506
|
-
"vue/object-curly-newline": [
|
|
507
|
-
"error",
|
|
508
|
-
{
|
|
509
|
-
multiline: true,
|
|
510
|
-
consistent: true
|
|
511
|
-
}
|
|
512
|
-
],
|
|
513
|
-
"vue/no-static-inline-styles": [
|
|
514
|
-
"error",
|
|
515
|
-
{
|
|
516
|
-
allowBinding: true
|
|
517
|
-
}
|
|
518
|
-
],
|
|
519
|
-
"vue/object-curly-spacing": ["error", "always"],
|
|
520
|
-
"vue/object-property-newline": [
|
|
521
|
-
"error",
|
|
522
|
-
{
|
|
523
|
-
allowMultiplePropertiesPerLine: true
|
|
524
|
-
}
|
|
525
|
-
],
|
|
526
|
-
"vue/object-shorthand": [
|
|
527
|
-
"error",
|
|
528
|
-
"always",
|
|
529
|
-
{
|
|
530
|
-
ignoreConstructors: false,
|
|
531
|
-
avoidQuotes: true
|
|
532
|
-
}
|
|
533
|
-
],
|
|
534
|
-
"vue/operator-linebreak": ["error", "before"],
|
|
535
|
-
"vue/prefer-template": "error",
|
|
536
554
|
"vue/prop-name-casing": ["error", "camelCase"],
|
|
537
|
-
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
538
|
-
"vue/space-in-parens": ["error", "never"],
|
|
539
|
-
"vue/space-infix-ops": "error",
|
|
540
|
-
"vue/space-unary-ops": [
|
|
541
|
-
"error",
|
|
542
|
-
{
|
|
543
|
-
words: true,
|
|
544
|
-
nonwords: false
|
|
545
|
-
}
|
|
546
|
-
],
|
|
547
|
-
"vue/template-curly-spacing": "error",
|
|
548
|
-
"vue/block-order": [
|
|
549
|
-
"error",
|
|
550
|
-
{
|
|
551
|
-
order: ["script", "template", "style"]
|
|
552
|
-
}
|
|
553
|
-
],
|
|
554
555
|
"vue/attributes-order": [
|
|
555
556
|
"error",
|
|
556
557
|
{
|
|
@@ -635,6 +636,9 @@ var vue = (options = {}) => {
|
|
|
635
636
|
multiline: 1
|
|
636
637
|
}
|
|
637
638
|
],
|
|
639
|
+
...disabledRules,
|
|
640
|
+
...extensionRules,
|
|
641
|
+
...unCategorizedRules,
|
|
638
642
|
// Overrides rules
|
|
639
643
|
...options.overrides
|
|
640
644
|
}
|
|
@@ -815,22 +819,35 @@ var sort = (options = {}) => {
|
|
|
815
819
|
{
|
|
816
820
|
pathPattern: "^$",
|
|
817
821
|
order: [
|
|
822
|
+
/**
|
|
823
|
+
* Meta
|
|
824
|
+
*/
|
|
818
825
|
"publisher",
|
|
819
826
|
"name",
|
|
820
827
|
"displayName",
|
|
821
828
|
"preview",
|
|
822
829
|
"type",
|
|
830
|
+
"config",
|
|
823
831
|
"version",
|
|
824
832
|
"private",
|
|
825
833
|
"packageManager",
|
|
834
|
+
"workspaces",
|
|
826
835
|
"description",
|
|
827
836
|
"keywords",
|
|
828
837
|
"license",
|
|
838
|
+
"licenses",
|
|
829
839
|
"author",
|
|
840
|
+
"contributors",
|
|
841
|
+
"maintainers",
|
|
830
842
|
"homepage",
|
|
831
843
|
"repository",
|
|
844
|
+
"bugs",
|
|
832
845
|
"funding",
|
|
846
|
+
/**
|
|
847
|
+
* Publish
|
|
848
|
+
*/
|
|
833
849
|
"exports",
|
|
850
|
+
"imports",
|
|
834
851
|
"main",
|
|
835
852
|
"module",
|
|
836
853
|
"unpkg",
|
|
@@ -841,20 +858,39 @@ var sort = (options = {}) => {
|
|
|
841
858
|
"bin",
|
|
842
859
|
"icon",
|
|
843
860
|
"files",
|
|
861
|
+
"directories",
|
|
862
|
+
"publishConfig",
|
|
863
|
+
/**
|
|
864
|
+
* Misc
|
|
865
|
+
*/
|
|
844
866
|
"sideEffects",
|
|
845
867
|
"scripts",
|
|
868
|
+
/**
|
|
869
|
+
* Dependencies
|
|
870
|
+
*/
|
|
846
871
|
"peerDependencies",
|
|
847
872
|
"peerDependenciesMeta",
|
|
873
|
+
"bundledDependencies",
|
|
874
|
+
"bundleDependencies",
|
|
848
875
|
"dependencies",
|
|
849
876
|
"optionalDependencies",
|
|
850
877
|
"devDependencies",
|
|
878
|
+
/**
|
|
879
|
+
* VSCode extension
|
|
880
|
+
*/
|
|
851
881
|
"activationEvents",
|
|
852
882
|
"contributes",
|
|
853
883
|
"categories",
|
|
884
|
+
/**
|
|
885
|
+
* Package manager
|
|
886
|
+
*/
|
|
854
887
|
"engines",
|
|
855
888
|
"pnpm",
|
|
856
889
|
"overrides",
|
|
857
890
|
"resolutions",
|
|
891
|
+
/**
|
|
892
|
+
* Third party
|
|
893
|
+
*/
|
|
858
894
|
"husky",
|
|
859
895
|
"prettier",
|
|
860
896
|
"nano-staged",
|