@favorodera/eslint-config 1.0.0 → 1.0.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/dist/index.d.mts +2 -2
- package/dist/index.mjs +233 -231
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18278,7 +18278,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
18278
18278
|
exceptRange?: boolean;
|
|
18279
18279
|
onlyEquality?: boolean;
|
|
18280
18280
|
}]; // Names of all the configs
|
|
18281
|
-
type ConfigNames = 'favorodera/ignores' | 'favorodera/imports/setup' | 'favorodera/imports/rules' | 'favorodera/javascript/setup' | 'favorodera/javascript/rules' | 'favorodera/jsdoc/recommended/setup' | 'favorodera/jsdoc/stylistic/setup' | 'favorodera/jsdoc/rules' | 'favorodera/jsonc/setup' | 'favorodera/jsonc/rules' | 'favorodera/jsonc/sort/package-json' | 'favorodera/jsonc/sort/tsconfig-json' | 'favorodera/
|
|
18281
|
+
type ConfigNames = 'favorodera/ignores' | 'favorodera/imports/setup' | 'favorodera/imports/rules' | 'favorodera/javascript/setup' | 'favorodera/javascript/rules' | 'favorodera/jsdoc/recommended/setup' | 'favorodera/jsdoc/stylistic/setup' | 'favorodera/jsdoc/rules' | 'favorodera/jsonc/setup' | 'favorodera/jsonc/rules' | 'favorodera/jsonc/sort/package-json' | 'favorodera/jsonc/sort/tsconfig-json' | 'favorodera/markdown/setup' | 'favorodera/markdown/rules' | 'favorodera/node/setup' | 'favorodera/node/rules' | 'favorodera/perfectionist/setup' | 'favorodera/perfectionist/rules' | 'favorodera/pnpm/setup' | 'favorodera/pnpm/package-json' | 'favorodera/pnpm/pnpm-workspace-yaml' | 'favorodera/stylistic/setup' | 'favorodera/stylistic/rules' | 'favorodera/tailwind/recommended/setup' | 'favorodera/tailwind/stylistic/setup' | 'favorodera/tailwind/rules' | 'favorodera/test/setup' | 'favorodera/test/rules' | 'favorodera/typescript/setup' | 'favorodera/typescript/rules' | 'favorodera/unicorn/setup' | 'favorodera/unicorn/rules' | 'favorodera/unused-imports/setup' | 'favorodera/unused-imports/rules' | 'favorodera/vue/setup' | 'favorodera/vue/a11y/setup' | 'favorodera/vue/rules' | 'favorodera/vue/a11y/rules' | 'favorodera/yaml/setup' | 'favorodera/yaml/rules' | 'favorodera/yaml/sort/pnpm-workspace-yaml' | 'favorodera/disables/jsonc' | 'favorodera/disables/markdown' | 'favorodera/disables/code-in-markdown' | 'favorodera/disables/js-ts-vue' | 'favorodera/disables/vue' | 'favorodera/disables/test';
|
|
18282
18282
|
//#endregion
|
|
18283
18283
|
//#region src/types/utils.d.ts
|
|
18284
18284
|
/** ESLint rules configuration with type-safe autocompletion */
|
|
@@ -18517,7 +18517,7 @@ declare const mdGlob = "**/*.md";
|
|
|
18517
18517
|
/** Glob pattern for matching virtual files extracted from Markdown */
|
|
18518
18518
|
declare const mdInMdGlob = "**/*.md/*.md";
|
|
18519
18519
|
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
18520
|
-
declare const codeInMdGlob = "**/*.md
|
|
18520
|
+
declare const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
18521
18521
|
/** Glob pattern for matching scripts files */
|
|
18522
18522
|
declare const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
18523
18523
|
/** Glob pattern for matching test files */
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const mdGlob = "**/*.md";
|
|
|
15
15
|
/** Glob pattern for matching virtual files extracted from Markdown */
|
|
16
16
|
const mdInMdGlob = "**/*.md/*.md";
|
|
17
17
|
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
18
|
-
const codeInMdGlob = "**/*.md
|
|
18
|
+
const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
19
19
|
/** Glob pattern for matching scripts files */
|
|
20
20
|
const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
21
21
|
/** Glob pattern for matching test files */
|
|
@@ -76,6 +76,99 @@ const ignoresGlob = [
|
|
|
76
76
|
"**/.*/skills"
|
|
77
77
|
];
|
|
78
78
|
//#endregion
|
|
79
|
+
//#region src/configs/disables.ts
|
|
80
|
+
/**
|
|
81
|
+
* Centralized disable configs applied **last** in the composer chain
|
|
82
|
+
* so they always override any rule enabled by preceding configs.
|
|
83
|
+
* @returns Config items that turn off specific rules for targeted file globs.
|
|
84
|
+
*/
|
|
85
|
+
function disables() {
|
|
86
|
+
return [
|
|
87
|
+
{
|
|
88
|
+
files: [
|
|
89
|
+
json5Glob,
|
|
90
|
+
jsoncGlob,
|
|
91
|
+
jsonGlob
|
|
92
|
+
],
|
|
93
|
+
name: "favorodera/disables/jsonc",
|
|
94
|
+
rules: { "no-irregular-whitespace": "off" }
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
files: [mdGlob],
|
|
98
|
+
ignores: [mdInMdGlob],
|
|
99
|
+
languageOptions: { frontmatter: "yaml" },
|
|
100
|
+
name: "favorodera/disables/markdown",
|
|
101
|
+
rules: { "md/no-missing-atx-heading-space": "off" }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
files: [codeInMdGlob],
|
|
105
|
+
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
106
|
+
name: "favorodera/disables/code-in-markdown",
|
|
107
|
+
rules: {
|
|
108
|
+
"no-alert": "off",
|
|
109
|
+
"no-console": "off",
|
|
110
|
+
"no-labels": "off",
|
|
111
|
+
"no-lone-blocks": "off",
|
|
112
|
+
"no-restricted-syntax": "off",
|
|
113
|
+
"no-undef": "off",
|
|
114
|
+
"no-unused-expressions": "off",
|
|
115
|
+
"no-unused-labels": "off",
|
|
116
|
+
"no-unused-vars": "off",
|
|
117
|
+
"unicode-bom": "off",
|
|
118
|
+
"node/prefer-global/process": "off",
|
|
119
|
+
"style/comma-dangle": "off",
|
|
120
|
+
"style/eol-last": "off",
|
|
121
|
+
"style/line-comment-position": "off",
|
|
122
|
+
"style/padding-line-between-statements": "off",
|
|
123
|
+
"ts/consistent-type-imports": "off",
|
|
124
|
+
"ts/explicit-function-return-type": "off",
|
|
125
|
+
"ts/no-namespace": "off",
|
|
126
|
+
"ts/no-redeclare": "off",
|
|
127
|
+
"ts/no-require-imports": "off",
|
|
128
|
+
"ts/no-unused-expressions": "off",
|
|
129
|
+
"ts/no-unused-vars": "off",
|
|
130
|
+
"ts/no-use-before-define": "off",
|
|
131
|
+
"unused-imports/no-unused-imports": "off",
|
|
132
|
+
"unused-imports/no-unused-vars": "off",
|
|
133
|
+
"vue/no-unused-vars": "off",
|
|
134
|
+
"jsdoc/require-jsdoc": "off"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
files: [
|
|
139
|
+
jsGlob,
|
|
140
|
+
tsGlob,
|
|
141
|
+
vueGlob
|
|
142
|
+
],
|
|
143
|
+
name: "favorodera/disables/js-ts-vue",
|
|
144
|
+
rules: {
|
|
145
|
+
"jsdoc/require-throws-type": "off",
|
|
146
|
+
"node/no-missing-import": "off",
|
|
147
|
+
"node/no-missing-require": "off",
|
|
148
|
+
"node/no-process-exit": "off",
|
|
149
|
+
"tailwind/enforce-consistent-important-position": "off",
|
|
150
|
+
"tailwind/enforce-consistent-variable-syntax": "off",
|
|
151
|
+
"tailwind/enforce-shorthand-classes": "off",
|
|
152
|
+
"unicorn/filename-case": "off",
|
|
153
|
+
"unicorn/no-process-exit": "off",
|
|
154
|
+
"unicorn/prevent-abbreviations": "off",
|
|
155
|
+
"no-unused-vars": "off",
|
|
156
|
+
"ts/no-unused-vars": "off"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
files: [vueGlob],
|
|
161
|
+
name: "favorodera/disables/vue",
|
|
162
|
+
rules: { "vue/multi-word-component-names": "off" }
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
files: [testGlob],
|
|
166
|
+
name: "favorodera/disables/test",
|
|
167
|
+
rules: { "no-unused-expressions": "off" }
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
79
172
|
//#region src/configs/ignores.ts
|
|
80
173
|
const defaultPatterns = ignoresGlob;
|
|
81
174
|
/**
|
|
@@ -356,7 +449,6 @@ async function jsdoc() {
|
|
|
356
449
|
"jsdoc/no-bad-blocks": "error",
|
|
357
450
|
"jsdoc/no-blank-block-descriptions": "error",
|
|
358
451
|
"jsdoc/no-blank-blocks": "error",
|
|
359
|
-
"jsdoc/require-throws-type": "off",
|
|
360
452
|
"jsdoc/sort-tags": "error"
|
|
361
453
|
}
|
|
362
454
|
}
|
|
@@ -370,19 +462,17 @@ async function jsdoc() {
|
|
|
370
462
|
* @returns Promise resolving to JSONC ESLint config items.
|
|
371
463
|
*/
|
|
372
464
|
async function jsonc() {
|
|
373
|
-
const jsoncPlugin = await importModule(import("eslint-plugin-jsonc"));
|
|
374
|
-
const files = [
|
|
375
|
-
json5Glob,
|
|
376
|
-
jsoncGlob,
|
|
377
|
-
jsonGlob
|
|
378
|
-
];
|
|
379
465
|
return [
|
|
380
466
|
{
|
|
381
467
|
name: "favorodera/jsonc/setup",
|
|
382
|
-
plugins: { jsonc:
|
|
468
|
+
plugins: { jsonc: await importModule(import("eslint-plugin-jsonc")) }
|
|
383
469
|
},
|
|
384
470
|
{
|
|
385
|
-
files
|
|
471
|
+
files: [
|
|
472
|
+
json5Glob,
|
|
473
|
+
jsoncGlob,
|
|
474
|
+
jsonGlob
|
|
475
|
+
],
|
|
386
476
|
language: "jsonc/x",
|
|
387
477
|
name: "favorodera/jsonc/rules",
|
|
388
478
|
rules: {
|
|
@@ -649,12 +739,6 @@ async function jsonc() {
|
|
|
649
739
|
pathPattern: "^compilerOptions$"
|
|
650
740
|
}
|
|
651
741
|
] }
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
files,
|
|
655
|
-
language: "jsonc/x",
|
|
656
|
-
name: "favorodera/jsonc/disables",
|
|
657
|
-
rules: { "no-irregular-whitespace": "off" }
|
|
658
742
|
}
|
|
659
743
|
];
|
|
660
744
|
}
|
|
@@ -672,63 +756,23 @@ async function markdown(options) {
|
|
|
672
756
|
const markdownPlugin = await importModule(import("@eslint/markdown"));
|
|
673
757
|
const [recommendedConfig] = markdownPlugin.configs.recommended;
|
|
674
758
|
const { rules = {} } = recommendedConfig;
|
|
675
|
-
return [
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
rules: {
|
|
693
|
-
...rules,
|
|
694
|
-
"md/fenced-code-language": "off",
|
|
695
|
-
"md/no-missing-label-refs": "off"
|
|
696
|
-
}
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
files: [codeInMdGlob],
|
|
700
|
-
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
701
|
-
name: "favorodera/markdown/code-in-md/disables",
|
|
702
|
-
rules: {
|
|
703
|
-
"no-alert": "off",
|
|
704
|
-
"no-console": "off",
|
|
705
|
-
"no-labels": "off",
|
|
706
|
-
"no-lone-blocks": "off",
|
|
707
|
-
"no-restricted-syntax": "off",
|
|
708
|
-
"no-undef": "off",
|
|
709
|
-
"no-unused-expressions": "off",
|
|
710
|
-
"no-unused-labels": "off",
|
|
711
|
-
"no-unused-vars": "off",
|
|
712
|
-
"unicode-bom": "off",
|
|
713
|
-
"node/prefer-global/process": "off",
|
|
714
|
-
"style/comma-dangle": "off",
|
|
715
|
-
"style/eol-last": "off",
|
|
716
|
-
"style/padding-line-between-statements": "off",
|
|
717
|
-
"ts/consistent-type-imports": "off",
|
|
718
|
-
"ts/explicit-function-return-type": "off",
|
|
719
|
-
"ts/no-namespace": "off",
|
|
720
|
-
"ts/no-redeclare": "off",
|
|
721
|
-
"ts/no-require-imports": "off",
|
|
722
|
-
"ts/no-unused-expressions": "off",
|
|
723
|
-
"ts/no-unused-vars": "off",
|
|
724
|
-
"ts/no-use-before-define": "off",
|
|
725
|
-
"unused-imports/no-unused-imports": "off",
|
|
726
|
-
"unused-imports/no-unused-vars": "off",
|
|
727
|
-
"vue/no-unused-vars": "off",
|
|
728
|
-
"jsdoc/require-jsdoc": "off"
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
];
|
|
759
|
+
return [{
|
|
760
|
+
...omit(recommendedConfig, [
|
|
761
|
+
"rules",
|
|
762
|
+
"files",
|
|
763
|
+
"name",
|
|
764
|
+
"language"
|
|
765
|
+
]),
|
|
766
|
+
name: "favorodera/markdown/setup"
|
|
767
|
+
}, {
|
|
768
|
+
files: [mdGlob],
|
|
769
|
+
ignores: [mdInMdGlob],
|
|
770
|
+
language: resolved.gfm ? "md/gfm" : "md/commonmark",
|
|
771
|
+
languageOptions: { frontmatter: "yaml" },
|
|
772
|
+
name: "favorodera/markdown/rules",
|
|
773
|
+
processor: mergeProcessors([markdownPlugin.processors?.markdown, processorPassThrough]),
|
|
774
|
+
rules
|
|
775
|
+
}];
|
|
732
776
|
}
|
|
733
777
|
//#endregion
|
|
734
778
|
//#region src/configs/node.ts
|
|
@@ -746,50 +790,38 @@ async function node() {
|
|
|
746
790
|
];
|
|
747
791
|
const recommendedConfig = nodePlugin.configs["flat/recommended-module"];
|
|
748
792
|
const { rules = {} } = recommendedConfig;
|
|
749
|
-
return [
|
|
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
|
-
"node/prefer-promises/dns": "error",
|
|
780
|
-
"node/prefer-promises/fs": "error",
|
|
781
|
-
"node/no-process-exit": "off"
|
|
782
|
-
}
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
files,
|
|
786
|
-
name: "favorodera/node/disables",
|
|
787
|
-
rules: {
|
|
788
|
-
"node/no-missing-import": "off",
|
|
789
|
-
"node/no-missing-require": "off"
|
|
790
|
-
}
|
|
793
|
+
return [{
|
|
794
|
+
...omit(recommendedConfig, [
|
|
795
|
+
"rules",
|
|
796
|
+
"files",
|
|
797
|
+
"name"
|
|
798
|
+
]),
|
|
799
|
+
name: "favorodera/node/setup"
|
|
800
|
+
}, {
|
|
801
|
+
files,
|
|
802
|
+
name: "favorodera/node/rules",
|
|
803
|
+
rules: {
|
|
804
|
+
...rules,
|
|
805
|
+
"node/callback-return": "error",
|
|
806
|
+
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
807
|
+
"node/no-callback-literal": "error",
|
|
808
|
+
"node/no-new-require": "error",
|
|
809
|
+
"node/no-path-concat": "error",
|
|
810
|
+
"node/no-unpublished-import": "error",
|
|
811
|
+
"node/prefer-global/buffer": "error",
|
|
812
|
+
"node/prefer-global/console": "error",
|
|
813
|
+
"node/prefer-global/crypto": "error",
|
|
814
|
+
"node/prefer-global/process": "error",
|
|
815
|
+
"node/prefer-global/text-decoder": "error",
|
|
816
|
+
"node/prefer-global/text-encoder": "error",
|
|
817
|
+
"node/prefer-global/timers": "error",
|
|
818
|
+
"node/prefer-global/url": "error",
|
|
819
|
+
"node/prefer-global/url-search-params": "error",
|
|
820
|
+
"node/prefer-node-protocol": "error",
|
|
821
|
+
"node/prefer-promises/dns": "error",
|
|
822
|
+
"node/prefer-promises/fs": "error"
|
|
791
823
|
}
|
|
792
|
-
];
|
|
824
|
+
}];
|
|
793
825
|
}
|
|
794
826
|
//#endregion
|
|
795
827
|
//#region src/configs/perfectionist.ts
|
|
@@ -1005,10 +1037,7 @@ async function tailwind(options) {
|
|
|
1005
1037
|
}],
|
|
1006
1038
|
"tailwind/enforce-consistent-line-wrapping": ["error", { group: "emptyLine" }],
|
|
1007
1039
|
"tailwind/enforce-consistent-variant-order": "error",
|
|
1008
|
-
"tailwind/enforce-logical-properties": "error"
|
|
1009
|
-
"tailwind/enforce-consistent-important-position": "off",
|
|
1010
|
-
"tailwind/enforce-consistent-variable-syntax": "off",
|
|
1011
|
-
"tailwind/enforce-shorthand-classes": "off"
|
|
1040
|
+
"tailwind/enforce-logical-properties": "error"
|
|
1012
1041
|
},
|
|
1013
1042
|
settings: { "better-tailwindcss": resolved }
|
|
1014
1043
|
}
|
|
@@ -1026,77 +1055,69 @@ async function test() {
|
|
|
1026
1055
|
const files = [testGlob];
|
|
1027
1056
|
const recommendedConfig = testPlugin.configs.recommended;
|
|
1028
1057
|
const { rules } = recommendedConfig;
|
|
1029
|
-
return [
|
|
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
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
"test/require-top-level-describe": "error",
|
|
1091
|
-
"test/warn-todo": "warn"
|
|
1092
|
-
}
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
files,
|
|
1096
|
-
name: "favorodera/test/disables",
|
|
1097
|
-
rules: { "no-unused-expressions": "off" }
|
|
1058
|
+
return [{
|
|
1059
|
+
...omit(recommendedConfig, ["rules", "name"]),
|
|
1060
|
+
name: "favorodera/test/setup"
|
|
1061
|
+
}, {
|
|
1062
|
+
files,
|
|
1063
|
+
name: "favorodera/test/rules",
|
|
1064
|
+
rules: {
|
|
1065
|
+
...rules,
|
|
1066
|
+
"test/consistent-each-for": ["error", {
|
|
1067
|
+
describe: "for",
|
|
1068
|
+
it: "for",
|
|
1069
|
+
suite: "for",
|
|
1070
|
+
test: "for"
|
|
1071
|
+
}],
|
|
1072
|
+
"test/consistent-test-it": ["error", {
|
|
1073
|
+
fn: "it",
|
|
1074
|
+
withinDescribe: "it"
|
|
1075
|
+
}],
|
|
1076
|
+
"test/consistent-vitest-vi": "error",
|
|
1077
|
+
"test/hoisted-apis-on-top": "error",
|
|
1078
|
+
"test/max-expects": "error",
|
|
1079
|
+
"test/max-nested-describe": "error",
|
|
1080
|
+
"test/no-alias-methods": "error",
|
|
1081
|
+
"test/no-conditional-in-test": "error",
|
|
1082
|
+
"test/no-conditional-tests": "error",
|
|
1083
|
+
"test/no-duplicate-hooks": "error",
|
|
1084
|
+
"test/no-hooks": "error",
|
|
1085
|
+
"test/no-large-snapshots": "warn",
|
|
1086
|
+
"test/no-test-prefixes": "error",
|
|
1087
|
+
"test/no-test-return-statement": "error",
|
|
1088
|
+
"test/padding-around-all": "error",
|
|
1089
|
+
"test/prefer-called-times": "error",
|
|
1090
|
+
"test/prefer-called-with": "error",
|
|
1091
|
+
"test/prefer-comparison-matcher": "error",
|
|
1092
|
+
"test/prefer-each": "error",
|
|
1093
|
+
"test/prefer-equality-matcher": "error",
|
|
1094
|
+
"test/prefer-expect-resolves": "error",
|
|
1095
|
+
"test/prefer-expect-type-of": "error",
|
|
1096
|
+
"test/prefer-hooks-in-order": "error",
|
|
1097
|
+
"test/prefer-hooks-on-top": "error",
|
|
1098
|
+
"test/prefer-import-in-mock": "error",
|
|
1099
|
+
"test/prefer-importing-vitest-globals": "error",
|
|
1100
|
+
"test/prefer-lowercase-title": "error",
|
|
1101
|
+
"test/prefer-mock-promise-shorthand": "error",
|
|
1102
|
+
"test/prefer-mock-return-shorthand": "error",
|
|
1103
|
+
"test/prefer-snapshot-hint": "error",
|
|
1104
|
+
"test/prefer-spy-on": "error",
|
|
1105
|
+
"test/prefer-strict-boolean-matchers": "error",
|
|
1106
|
+
"test/prefer-strict-equal": "error",
|
|
1107
|
+
"test/prefer-to-be": "error",
|
|
1108
|
+
"test/prefer-to-be-object": "error",
|
|
1109
|
+
"test/prefer-to-contain": "error",
|
|
1110
|
+
"test/prefer-to-have-been-called-times": "error",
|
|
1111
|
+
"test/prefer-to-have-length": "error",
|
|
1112
|
+
"test/prefer-todo": "error",
|
|
1113
|
+
"test/prefer-vi-mocked": "error",
|
|
1114
|
+
"test/require-awaited-expect-poll": "error",
|
|
1115
|
+
"test/require-hook": "error",
|
|
1116
|
+
"test/require-to-throw-message": "error",
|
|
1117
|
+
"test/require-top-level-describe": "error",
|
|
1118
|
+
"test/warn-todo": "warn"
|
|
1098
1119
|
}
|
|
1099
|
-
];
|
|
1120
|
+
}];
|
|
1100
1121
|
}
|
|
1101
1122
|
//#endregion
|
|
1102
1123
|
//#region src/configs/typescript.ts
|
|
@@ -1163,12 +1184,7 @@ async function unicorn() {
|
|
|
1163
1184
|
}, {
|
|
1164
1185
|
files,
|
|
1165
1186
|
name: "favorodera/unicorn/rules",
|
|
1166
|
-
rules
|
|
1167
|
-
...rules,
|
|
1168
|
-
"unicorn/filename-case": "off",
|
|
1169
|
-
"unicorn/no-process-exit": "off",
|
|
1170
|
-
"unicorn/prevent-abbreviations": "off"
|
|
1171
|
-
}
|
|
1187
|
+
rules
|
|
1172
1188
|
}];
|
|
1173
1189
|
}
|
|
1174
1190
|
//#endregion
|
|
@@ -1179,40 +1195,27 @@ async function unicorn() {
|
|
|
1179
1195
|
* @returns Promise resolving to unused imports ESLint config items.
|
|
1180
1196
|
*/
|
|
1181
1197
|
async function unusedImports() {
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
ignoreRestSiblings: true,
|
|
1202
|
-
vars: "all",
|
|
1203
|
-
varsIgnorePattern: "^_"
|
|
1204
|
-
}]
|
|
1205
|
-
}
|
|
1206
|
-
},
|
|
1207
|
-
{
|
|
1208
|
-
files,
|
|
1209
|
-
name: "favorodera/unused-imports/disables",
|
|
1210
|
-
rules: {
|
|
1211
|
-
"no-unused-vars": "off",
|
|
1212
|
-
"ts/no-unused-vars": "off"
|
|
1213
|
-
}
|
|
1198
|
+
return [{
|
|
1199
|
+
name: "favorodera/unused-imports/setup",
|
|
1200
|
+
plugins: { "unused-imports": await importModule(import("eslint-plugin-unused-imports")) }
|
|
1201
|
+
}, {
|
|
1202
|
+
files: [
|
|
1203
|
+
jsGlob,
|
|
1204
|
+
tsGlob,
|
|
1205
|
+
vueGlob
|
|
1206
|
+
],
|
|
1207
|
+
name: "favorodera/unused-imports/rules",
|
|
1208
|
+
rules: {
|
|
1209
|
+
"unused-imports/no-unused-imports": "error",
|
|
1210
|
+
"unused-imports/no-unused-vars": ["error", {
|
|
1211
|
+
args: "after-used",
|
|
1212
|
+
argsIgnorePattern: "^_",
|
|
1213
|
+
ignoreRestSiblings: true,
|
|
1214
|
+
vars: "all",
|
|
1215
|
+
varsIgnorePattern: "^_"
|
|
1216
|
+
}]
|
|
1214
1217
|
}
|
|
1215
|
-
];
|
|
1218
|
+
}];
|
|
1216
1219
|
}
|
|
1217
1220
|
//#endregion
|
|
1218
1221
|
//#region src/configs/vue.ts
|
|
@@ -1312,7 +1315,6 @@ async function vue(options) {
|
|
|
1312
1315
|
}],
|
|
1313
1316
|
"vue/define-props-declaration": ["error", "type-based"],
|
|
1314
1317
|
"vue/define-props-destructuring": ["error", { destructure: "never" }],
|
|
1315
|
-
"vue/multi-word-component-names": "off",
|
|
1316
1318
|
"vue/next-tick-style": ["error", "promise"],
|
|
1317
1319
|
"vue/no-import-compiler-macros": "error",
|
|
1318
1320
|
"vue/no-negated-v-if-condition": "error",
|
|
@@ -1518,7 +1520,7 @@ function factory(options = {}) {
|
|
|
1518
1520
|
if (resolved) configs.push(configFunction(resolved));
|
|
1519
1521
|
}
|
|
1520
1522
|
let composer = new FlatConfigComposer();
|
|
1521
|
-
composer = composer.append(...configs).renamePlugins({
|
|
1523
|
+
composer = composer.append(...configs).append(...disables()).renamePlugins({
|
|
1522
1524
|
"@typescript-eslint": "ts",
|
|
1523
1525
|
"better-tailwindcss": "tailwind",
|
|
1524
1526
|
"import-lite": "import",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@favorodera/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Opinionated, type-safe flat ESLint configuration factory for Vue, TypeScript, Tailwind, and more.",
|
|
7
7
|
"author": "Favour Emeka <favorodera@gmail.com>",
|