@ntnyq/eslint-config 2.0.0-beta.21 → 2.0.0-beta.23
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.cjs +56 -118
- package/dist/index.d.cts +24 -35
- package/dist/index.d.ts +24 -35
- package/dist/index.js +91 -146
- package/package.json +18 -22
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
34
|
-
GLOB_ASTRO: () => GLOB_ASTRO,
|
|
35
34
|
GLOB_CSS: () => GLOB_CSS,
|
|
36
35
|
GLOB_DIST: () => GLOB_DIST,
|
|
37
36
|
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
@@ -54,7 +53,6 @@ __export(src_exports, {
|
|
|
54
53
|
GLOB_VUE: () => GLOB_VUE,
|
|
55
54
|
GLOB_YAML: () => GLOB_YAML,
|
|
56
55
|
all: () => all,
|
|
57
|
-
astro: () => astro,
|
|
58
56
|
basic: () => basic,
|
|
59
57
|
comments: () => comments,
|
|
60
58
|
common: () => common,
|
|
@@ -67,27 +65,22 @@ __export(src_exports, {
|
|
|
67
65
|
markdown: () => markdown,
|
|
68
66
|
node: () => node,
|
|
69
67
|
ntnyq: () => ntnyq,
|
|
70
|
-
parserAstro: () => import_astro_eslint_parser.default,
|
|
71
68
|
parserJsonc: () => import_jsonc_eslint_parser.default,
|
|
72
69
|
parserTs: () => parserTs,
|
|
73
70
|
parserVue: () => import_vue_eslint_parser.default,
|
|
74
71
|
parserYaml: () => import_yaml_eslint_parser.default,
|
|
75
|
-
pluginAstro: () => pluginAstro,
|
|
76
72
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
77
73
|
pluginImport: () => import_eslint_plugin_i.default,
|
|
78
74
|
pluginJsonc: () => import_eslint_plugin_jsonc.default,
|
|
79
75
|
pluginMarkdown: () => import_eslint_plugin_markdown.default,
|
|
80
76
|
pluginNode: () => import_eslint_plugin_n.default,
|
|
81
77
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
82
|
-
pluginReact: () => import_eslint_plugin_react.default,
|
|
83
|
-
pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
|
|
84
78
|
pluginTs: () => import_eslint_plugin2.default,
|
|
85
79
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
86
80
|
pluginUnoCSS: () => import_eslint_plugin.default,
|
|
87
81
|
pluginVue: () => import_eslint_plugin_vue.default,
|
|
88
82
|
pluginYaml: () => pluginYaml,
|
|
89
83
|
prettier: () => prettier,
|
|
90
|
-
react: () => react,
|
|
91
84
|
sortPackageJson: () => sortPackageJson,
|
|
92
85
|
sortTsConfig: () => sortTsConfig,
|
|
93
86
|
typescript: () => typescript,
|
|
@@ -113,7 +106,6 @@ var GLOB_JSON = "**/*.json";
|
|
|
113
106
|
var GLOB_JSON5 = "**/*.json5";
|
|
114
107
|
var GLOB_JSONC = "**/*.jsonc";
|
|
115
108
|
var GLOB_VUE = "**/*.vue";
|
|
116
|
-
var GLOB_ASTRO = "**/*.astro";
|
|
117
109
|
var GLOB_MARKDOWN = "**/*.md";
|
|
118
110
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
119
111
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -158,33 +150,34 @@ var GLOB_EXCLUDE = [
|
|
|
158
150
|
"**/.yarnrc"
|
|
159
151
|
];
|
|
160
152
|
|
|
153
|
+
// src/presets.ts
|
|
154
|
+
var import_eslint_define_config15 = require("eslint-define-config");
|
|
155
|
+
|
|
161
156
|
// src/configs/vue.ts
|
|
162
157
|
var import_node_process = __toESM(require("process"), 1);
|
|
163
158
|
var import_local_pkg = require("local-pkg");
|
|
159
|
+
var import_eslint_define_config2 = require("eslint-define-config");
|
|
164
160
|
|
|
165
161
|
// src/plugins.ts
|
|
166
162
|
var pluginYaml = __toESM(require("eslint-plugin-yml"), 1);
|
|
167
|
-
var pluginAstro = __toESM(require("eslint-plugin-astro"), 1);
|
|
168
163
|
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
169
164
|
var import_eslint_plugin_i = __toESM(require("eslint-plugin-i"), 1);
|
|
170
165
|
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
171
166
|
var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
172
|
-
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
|
173
167
|
var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
174
168
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
175
169
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
176
170
|
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
177
|
-
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
178
171
|
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
179
172
|
var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
180
173
|
var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
|
|
181
174
|
var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
|
|
182
175
|
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
183
|
-
var import_astro_eslint_parser = __toESM(require("astro-eslint-parser"), 1);
|
|
184
176
|
var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
|
|
185
177
|
|
|
186
178
|
// src/configs/typescript.ts
|
|
187
|
-
var
|
|
179
|
+
var import_eslint_define_config = require("eslint-define-config");
|
|
180
|
+
var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
188
181
|
{
|
|
189
182
|
files: [GLOB_TS, GLOB_TSX],
|
|
190
183
|
languageOptions: {
|
|
@@ -255,7 +248,7 @@ var typescript = [
|
|
|
255
248
|
"@typescript-eslint/no-var-requires": "off"
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
|
-
];
|
|
251
|
+
]);
|
|
259
252
|
|
|
260
253
|
// src/configs/vue.ts
|
|
261
254
|
function getVueVersion() {
|
|
@@ -273,7 +266,7 @@ var vue2Rules = {
|
|
|
273
266
|
var vue3Rules = {
|
|
274
267
|
...vueBaseRules
|
|
275
268
|
};
|
|
276
|
-
var vue = [
|
|
269
|
+
var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
277
270
|
{
|
|
278
271
|
files: [GLOB_VUE],
|
|
279
272
|
plugins: {
|
|
@@ -302,10 +295,11 @@ var vue = [
|
|
|
302
295
|
},
|
|
303
296
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
304
297
|
}
|
|
305
|
-
];
|
|
298
|
+
]);
|
|
306
299
|
|
|
307
300
|
// src/configs/yml.ts
|
|
308
|
-
var
|
|
301
|
+
var import_eslint_define_config3 = require("eslint-define-config");
|
|
302
|
+
var yml = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
309
303
|
{
|
|
310
304
|
files: [GLOB_YAML],
|
|
311
305
|
languageOptions: {
|
|
@@ -321,10 +315,11 @@ var yml = [
|
|
|
321
315
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
322
316
|
}
|
|
323
317
|
}
|
|
324
|
-
];
|
|
318
|
+
]);
|
|
325
319
|
|
|
326
320
|
// src/configs/node.ts
|
|
327
|
-
var
|
|
321
|
+
var import_eslint_define_config4 = require("eslint-define-config");
|
|
322
|
+
var node = (0, import_eslint_define_config4.defineFlatConfig)([
|
|
328
323
|
{
|
|
329
324
|
plugins: {
|
|
330
325
|
node: import_eslint_plugin_n.default
|
|
@@ -340,10 +335,11 @@ var node = [
|
|
|
340
335
|
"node/process-exit-as-throw": "error"
|
|
341
336
|
}
|
|
342
337
|
}
|
|
343
|
-
];
|
|
338
|
+
]);
|
|
344
339
|
|
|
345
340
|
// src/configs/sort.ts
|
|
346
|
-
var
|
|
341
|
+
var import_eslint_define_config5 = require("eslint-define-config");
|
|
342
|
+
var sortPackageJson = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
347
343
|
{
|
|
348
344
|
files: ["**/package.json"],
|
|
349
345
|
rules: {
|
|
@@ -420,8 +416,8 @@ var sortPackageJson = [
|
|
|
420
416
|
]
|
|
421
417
|
}
|
|
422
418
|
}
|
|
423
|
-
];
|
|
424
|
-
var sortTsConfig = [
|
|
419
|
+
]);
|
|
420
|
+
var sortTsConfig = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
425
421
|
{
|
|
426
422
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
427
423
|
rules: {
|
|
@@ -535,59 +531,11 @@ var sortTsConfig = [
|
|
|
535
531
|
]
|
|
536
532
|
}
|
|
537
533
|
}
|
|
538
|
-
];
|
|
539
|
-
|
|
540
|
-
// src/configs/react.ts
|
|
541
|
-
var react = [
|
|
542
|
-
{
|
|
543
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
544
|
-
plugins: {
|
|
545
|
-
react: import_eslint_plugin_react.default,
|
|
546
|
-
"react-hooks": import_eslint_plugin_react_hooks.default
|
|
547
|
-
},
|
|
548
|
-
settings: {
|
|
549
|
-
react: {
|
|
550
|
-
version: "18.0"
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
languageOptions: {
|
|
554
|
-
parserOptions: {
|
|
555
|
-
ecmaFeatures: {
|
|
556
|
-
jsx: true
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
rules: {
|
|
561
|
-
...import_eslint_plugin_react.default.configs.recommended.rules,
|
|
562
|
-
...import_eslint_plugin_react_hooks.default.configs.recommended.rules,
|
|
563
|
-
"jsx-quotes": ["error", "prefer-double"],
|
|
564
|
-
"react/react-in-jsx-scope": "off"
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
];
|
|
568
|
-
|
|
569
|
-
// src/configs/astro.ts
|
|
570
|
-
var astro = [
|
|
571
|
-
{
|
|
572
|
-
files: [GLOB_ASTRO],
|
|
573
|
-
plugins: {
|
|
574
|
-
astro: pluginAstro
|
|
575
|
-
},
|
|
576
|
-
languageOptions: {
|
|
577
|
-
parser: import_astro_eslint_parser.default,
|
|
578
|
-
parserOptions: {
|
|
579
|
-
parser: "@typescript-eslint/parser",
|
|
580
|
-
extraFileExtensions: [".astro"]
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
rules: {
|
|
584
|
-
...pluginAstro.configs.recommended.rules
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
];
|
|
534
|
+
]);
|
|
588
535
|
|
|
589
536
|
// src/configs/jsonc.ts
|
|
590
|
-
var
|
|
537
|
+
var import_eslint_define_config6 = require("eslint-define-config");
|
|
538
|
+
var jsonc = (0, import_eslint_define_config6.defineFlatConfig)([
|
|
591
539
|
{
|
|
592
540
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
593
541
|
plugins: {
|
|
@@ -626,10 +574,11 @@ var jsonc = [
|
|
|
626
574
|
]
|
|
627
575
|
}
|
|
628
576
|
}
|
|
629
|
-
];
|
|
577
|
+
]);
|
|
630
578
|
|
|
631
579
|
// src/configs/imports.ts
|
|
632
|
-
var
|
|
580
|
+
var import_eslint_define_config7 = require("eslint-define-config");
|
|
581
|
+
var imports = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
633
582
|
{
|
|
634
583
|
plugins: {
|
|
635
584
|
import: import_eslint_plugin_i.default
|
|
@@ -668,10 +617,11 @@ var imports = [
|
|
|
668
617
|
]
|
|
669
618
|
}
|
|
670
619
|
}
|
|
671
|
-
];
|
|
620
|
+
]);
|
|
672
621
|
|
|
673
622
|
// src/configs/unocss.ts
|
|
674
|
-
var
|
|
623
|
+
var import_eslint_define_config8 = require("eslint-define-config");
|
|
624
|
+
var unocss = (0, import_eslint_define_config8.defineFlatConfig)([
|
|
675
625
|
{
|
|
676
626
|
plugins: {
|
|
677
627
|
"@unocss": import_eslint_plugin.default
|
|
@@ -680,10 +630,11 @@ var unocss = [
|
|
|
680
630
|
...import_eslint_plugin.default.configs.recommended.rules
|
|
681
631
|
}
|
|
682
632
|
}
|
|
683
|
-
];
|
|
633
|
+
]);
|
|
684
634
|
|
|
685
635
|
// src/configs/unicorn.ts
|
|
686
|
-
var
|
|
636
|
+
var import_eslint_define_config9 = require("eslint-define-config");
|
|
637
|
+
var unicorn = (0, import_eslint_define_config9.defineFlatConfig)([
|
|
687
638
|
{
|
|
688
639
|
plugins: {
|
|
689
640
|
unicorn: import_eslint_plugin_unicorn.default
|
|
@@ -755,11 +706,12 @@ var unicorn = [
|
|
|
755
706
|
"unicorn/prefer-array-index-of": "error"
|
|
756
707
|
}
|
|
757
708
|
}
|
|
758
|
-
];
|
|
709
|
+
]);
|
|
759
710
|
|
|
760
711
|
// src/configs/prettier.ts
|
|
761
712
|
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
762
|
-
var
|
|
713
|
+
var import_eslint_define_config10 = require("eslint-define-config");
|
|
714
|
+
var prettier = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
763
715
|
{
|
|
764
716
|
plugins: {
|
|
765
717
|
prettier: import_eslint_plugin_prettier.default
|
|
@@ -770,10 +722,11 @@ var prettier = [
|
|
|
770
722
|
"prettier/prettier": "warn"
|
|
771
723
|
}
|
|
772
724
|
}
|
|
773
|
-
];
|
|
725
|
+
]);
|
|
774
726
|
|
|
775
727
|
// src/configs/markdown.ts
|
|
776
|
-
var
|
|
728
|
+
var import_eslint_define_config11 = require("eslint-define-config");
|
|
729
|
+
var markdown = (0, import_eslint_define_config11.defineFlatConfig)([
|
|
777
730
|
{
|
|
778
731
|
files: [GLOB_MARKDOWN],
|
|
779
732
|
plugins: {
|
|
@@ -812,10 +765,11 @@ var markdown = [
|
|
|
812
765
|
"unused-imports/no-unused-vars": "off"
|
|
813
766
|
}
|
|
814
767
|
}
|
|
815
|
-
];
|
|
768
|
+
]);
|
|
816
769
|
|
|
817
770
|
// src/configs/comments.ts
|
|
818
|
-
var
|
|
771
|
+
var import_eslint_define_config12 = require("eslint-define-config");
|
|
772
|
+
var comments = (0, import_eslint_define_config12.defineFlatConfig)([
|
|
819
773
|
{
|
|
820
774
|
plugins: {
|
|
821
775
|
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
@@ -825,12 +779,13 @@ var comments = [
|
|
|
825
779
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
826
780
|
}
|
|
827
781
|
}
|
|
828
|
-
];
|
|
782
|
+
]);
|
|
829
783
|
|
|
830
784
|
// src/configs/javascript.ts
|
|
831
785
|
var import_globals = __toESM(require("globals"), 1);
|
|
832
786
|
var import_js = __toESM(require("@eslint/js"), 1);
|
|
833
|
-
var
|
|
787
|
+
var import_eslint_define_config13 = require("eslint-define-config");
|
|
788
|
+
var javascript = (0, import_eslint_define_config13.defineFlatConfig)([
|
|
834
789
|
import_js.default.configs.recommended,
|
|
835
790
|
{
|
|
836
791
|
languageOptions: {
|
|
@@ -1191,8 +1146,8 @@ var javascript = [
|
|
|
1191
1146
|
"max-lines-per-function": "off"
|
|
1192
1147
|
}
|
|
1193
1148
|
}
|
|
1194
|
-
];
|
|
1195
|
-
var jsx = [
|
|
1149
|
+
]);
|
|
1150
|
+
var jsx = (0, import_eslint_define_config13.defineFlatConfig)([
|
|
1196
1151
|
{
|
|
1197
1152
|
files: ["**/*.jsx"],
|
|
1198
1153
|
languageOptions: {
|
|
@@ -1203,17 +1158,18 @@ var jsx = [
|
|
|
1203
1158
|
}
|
|
1204
1159
|
}
|
|
1205
1160
|
}
|
|
1206
|
-
];
|
|
1161
|
+
]);
|
|
1207
1162
|
|
|
1208
1163
|
// src/configs/ignores.ts
|
|
1209
|
-
var
|
|
1164
|
+
var import_eslint_define_config14 = require("eslint-define-config");
|
|
1165
|
+
var ignores = (0, import_eslint_define_config14.defineFlatConfig)([
|
|
1210
1166
|
{
|
|
1211
1167
|
ignores: GLOB_EXCLUDE
|
|
1212
1168
|
}
|
|
1213
|
-
];
|
|
1169
|
+
]);
|
|
1214
1170
|
|
|
1215
1171
|
// src/presets.ts
|
|
1216
|
-
var basic = [
|
|
1172
|
+
var basic = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
1217
1173
|
...ignores,
|
|
1218
1174
|
...javascript,
|
|
1219
1175
|
...jsx,
|
|
@@ -1222,8 +1178,8 @@ var basic = [
|
|
|
1222
1178
|
...imports,
|
|
1223
1179
|
...unicorn,
|
|
1224
1180
|
...comments
|
|
1225
|
-
];
|
|
1226
|
-
var common = [
|
|
1181
|
+
]);
|
|
1182
|
+
var common = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
1227
1183
|
...basic,
|
|
1228
1184
|
...yml,
|
|
1229
1185
|
...jsonc,
|
|
@@ -1231,24 +1187,13 @@ var common = [
|
|
|
1231
1187
|
...sortTsConfig,
|
|
1232
1188
|
...prettier,
|
|
1233
1189
|
...markdown
|
|
1234
|
-
];
|
|
1235
|
-
var all = [...common, ...vue, ...
|
|
1236
|
-
function ntnyq(config = [], {
|
|
1237
|
-
|
|
1238
|
-
react: enableReact = false,
|
|
1239
|
-
astro: enableAstro = false,
|
|
1240
|
-
unocss: enableUnoCSS = false
|
|
1241
|
-
} = {}) {
|
|
1242
|
-
const configs = [...common];
|
|
1190
|
+
]);
|
|
1191
|
+
var all = (0, import_eslint_define_config15.defineFlatConfig)([...common, ...vue, ...unocss]);
|
|
1192
|
+
function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = false } = {}) {
|
|
1193
|
+
const configs = (0, import_eslint_define_config15.defineFlatConfig)([...common]);
|
|
1243
1194
|
if (enableVue) {
|
|
1244
1195
|
configs.push(...vue);
|
|
1245
1196
|
}
|
|
1246
|
-
if (enableReact) {
|
|
1247
|
-
configs.push(...react);
|
|
1248
|
-
}
|
|
1249
|
-
if (enableAstro) {
|
|
1250
|
-
configs.push(...astro);
|
|
1251
|
-
}
|
|
1252
1197
|
if (enableUnoCSS) {
|
|
1253
1198
|
configs.push(...unocss);
|
|
1254
1199
|
}
|
|
@@ -1260,7 +1205,6 @@ function ntnyq(config = [], {
|
|
|
1260
1205
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1261
1206
|
0 && (module.exports = {
|
|
1262
1207
|
GLOB_ALL_SRC,
|
|
1263
|
-
GLOB_ASTRO,
|
|
1264
1208
|
GLOB_CSS,
|
|
1265
1209
|
GLOB_DIST,
|
|
1266
1210
|
GLOB_EXCLUDE,
|
|
@@ -1283,7 +1227,6 @@ function ntnyq(config = [], {
|
|
|
1283
1227
|
GLOB_VUE,
|
|
1284
1228
|
GLOB_YAML,
|
|
1285
1229
|
all,
|
|
1286
|
-
astro,
|
|
1287
1230
|
basic,
|
|
1288
1231
|
comments,
|
|
1289
1232
|
common,
|
|
@@ -1296,27 +1239,22 @@ function ntnyq(config = [], {
|
|
|
1296
1239
|
markdown,
|
|
1297
1240
|
node,
|
|
1298
1241
|
ntnyq,
|
|
1299
|
-
parserAstro,
|
|
1300
1242
|
parserJsonc,
|
|
1301
1243
|
parserTs,
|
|
1302
1244
|
parserVue,
|
|
1303
1245
|
parserYaml,
|
|
1304
|
-
pluginAstro,
|
|
1305
1246
|
pluginComments,
|
|
1306
1247
|
pluginImport,
|
|
1307
1248
|
pluginJsonc,
|
|
1308
1249
|
pluginMarkdown,
|
|
1309
1250
|
pluginNode,
|
|
1310
1251
|
pluginPrettier,
|
|
1311
|
-
pluginReact,
|
|
1312
|
-
pluginReactHooks,
|
|
1313
1252
|
pluginTs,
|
|
1314
1253
|
pluginUnicorn,
|
|
1315
1254
|
pluginUnoCSS,
|
|
1316
1255
|
pluginVue,
|
|
1317
1256
|
pluginYaml,
|
|
1318
1257
|
prettier,
|
|
1319
|
-
react,
|
|
1320
1258
|
sortPackageJson,
|
|
1321
1259
|
sortTsConfig,
|
|
1322
1260
|
typescript,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as eslint_define_config from 'eslint-define-config';
|
|
2
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
2
3
|
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
3
4
|
export { eslintPluginYml as pluginYaml };
|
|
4
|
-
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
5
|
-
export { eslintPluginAstro as pluginAstro };
|
|
6
5
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
7
6
|
export { default as pluginImport } from 'eslint-plugin-i';
|
|
8
7
|
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
9
8
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
10
|
-
export { default as pluginReact } from 'eslint-plugin-react';
|
|
11
9
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
12
10
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
11
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
14
12
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
15
|
-
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
16
13
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
17
14
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
18
15
|
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
19
16
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
20
17
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
21
|
-
export { default as parserAstro } from 'astro-eslint-parser';
|
|
22
18
|
import * as parser from '@typescript-eslint/parser';
|
|
23
19
|
export { parser as parserTs };
|
|
24
20
|
|
|
@@ -39,7 +35,6 @@ declare const GLOB_JSON = "**/*.json";
|
|
|
39
35
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
40
36
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
41
37
|
declare const GLOB_VUE = "**/*.vue";
|
|
42
|
-
declare const GLOB_ASTRO = "**/*.astro";
|
|
43
38
|
declare const GLOB_MARKDOWN = "**/*.md";
|
|
44
39
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
45
40
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -56,58 +51,52 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
56
51
|
/**
|
|
57
52
|
* only js and ts
|
|
58
53
|
*/
|
|
59
|
-
declare const basic:
|
|
60
|
-
declare const common:
|
|
54
|
+
declare const basic: FlatESLintConfig[];
|
|
55
|
+
declare const common: FlatESLintConfig[];
|
|
61
56
|
/**
|
|
62
57
|
* all supported framework
|
|
63
58
|
*/
|
|
64
|
-
declare const all:
|
|
59
|
+
declare const all: FlatESLintConfig[];
|
|
65
60
|
/**
|
|
66
61
|
* custom framework support
|
|
67
62
|
*/
|
|
68
|
-
declare function ntnyq(config?:
|
|
63
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, unocss: enableUnoCSS }?: {
|
|
69
64
|
vue?: boolean | undefined;
|
|
70
|
-
react?: boolean | undefined;
|
|
71
|
-
astro?: boolean | undefined;
|
|
72
65
|
unocss?: boolean | undefined;
|
|
73
|
-
}):
|
|
66
|
+
}): FlatESLintConfig[];
|
|
74
67
|
|
|
75
68
|
declare function getVueVersion(): number;
|
|
76
|
-
declare const vue:
|
|
69
|
+
declare const vue: FlatESLintConfig[];
|
|
77
70
|
|
|
78
|
-
declare const yml:
|
|
71
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
79
72
|
|
|
80
|
-
declare const node:
|
|
73
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
81
74
|
|
|
82
|
-
declare const sortPackageJson:
|
|
83
|
-
declare const sortTsConfig:
|
|
75
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
76
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
84
77
|
|
|
85
|
-
declare const
|
|
78
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
86
79
|
|
|
87
|
-
declare const
|
|
80
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
88
81
|
|
|
89
|
-
declare const
|
|
82
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
90
83
|
|
|
91
|
-
declare const
|
|
84
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
92
85
|
|
|
93
|
-
declare const
|
|
86
|
+
declare const prettier: FlatESLintConfig[];
|
|
94
87
|
|
|
95
|
-
declare const
|
|
88
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
96
89
|
|
|
97
|
-
declare const
|
|
90
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
98
91
|
|
|
99
|
-
declare const
|
|
92
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
93
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
100
94
|
|
|
101
|
-
declare const
|
|
102
|
-
|
|
103
|
-
declare const javascript: FlatESLintConfigItem[];
|
|
104
|
-
declare const jsx: FlatESLintConfigItem[];
|
|
105
|
-
|
|
106
|
-
declare const typescript: FlatESLintConfigItem[];
|
|
95
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
107
96
|
|
|
108
97
|
/**
|
|
109
98
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
110
99
|
*/
|
|
111
|
-
declare const ignores:
|
|
100
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
112
101
|
|
|
113
|
-
export { GLOB_ALL_SRC,
|
|
102
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, common, getVueVersion, ignores, imports, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, sortPackageJson, sortTsConfig, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as eslint_define_config from 'eslint-define-config';
|
|
2
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
2
3
|
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
3
4
|
export { eslintPluginYml as pluginYaml };
|
|
4
|
-
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
5
|
-
export { eslintPluginAstro as pluginAstro };
|
|
6
5
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
7
6
|
export { default as pluginImport } from 'eslint-plugin-i';
|
|
8
7
|
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
9
8
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
10
|
-
export { default as pluginReact } from 'eslint-plugin-react';
|
|
11
9
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
12
10
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
11
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
14
12
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
15
|
-
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
16
13
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
17
14
|
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
18
15
|
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
19
16
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
20
17
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
21
|
-
export { default as parserAstro } from 'astro-eslint-parser';
|
|
22
18
|
import * as parser from '@typescript-eslint/parser';
|
|
23
19
|
export { parser as parserTs };
|
|
24
20
|
|
|
@@ -39,7 +35,6 @@ declare const GLOB_JSON = "**/*.json";
|
|
|
39
35
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
40
36
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
41
37
|
declare const GLOB_VUE = "**/*.vue";
|
|
42
|
-
declare const GLOB_ASTRO = "**/*.astro";
|
|
43
38
|
declare const GLOB_MARKDOWN = "**/*.md";
|
|
44
39
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
45
40
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -56,58 +51,52 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
56
51
|
/**
|
|
57
52
|
* only js and ts
|
|
58
53
|
*/
|
|
59
|
-
declare const basic:
|
|
60
|
-
declare const common:
|
|
54
|
+
declare const basic: FlatESLintConfig[];
|
|
55
|
+
declare const common: FlatESLintConfig[];
|
|
61
56
|
/**
|
|
62
57
|
* all supported framework
|
|
63
58
|
*/
|
|
64
|
-
declare const all:
|
|
59
|
+
declare const all: FlatESLintConfig[];
|
|
65
60
|
/**
|
|
66
61
|
* custom framework support
|
|
67
62
|
*/
|
|
68
|
-
declare function ntnyq(config?:
|
|
63
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, unocss: enableUnoCSS }?: {
|
|
69
64
|
vue?: boolean | undefined;
|
|
70
|
-
react?: boolean | undefined;
|
|
71
|
-
astro?: boolean | undefined;
|
|
72
65
|
unocss?: boolean | undefined;
|
|
73
|
-
}):
|
|
66
|
+
}): FlatESLintConfig[];
|
|
74
67
|
|
|
75
68
|
declare function getVueVersion(): number;
|
|
76
|
-
declare const vue:
|
|
69
|
+
declare const vue: FlatESLintConfig[];
|
|
77
70
|
|
|
78
|
-
declare const yml:
|
|
71
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
79
72
|
|
|
80
|
-
declare const node:
|
|
73
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
81
74
|
|
|
82
|
-
declare const sortPackageJson:
|
|
83
|
-
declare const sortTsConfig:
|
|
75
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
76
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
84
77
|
|
|
85
|
-
declare const
|
|
78
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
86
79
|
|
|
87
|
-
declare const
|
|
80
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
88
81
|
|
|
89
|
-
declare const
|
|
82
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
90
83
|
|
|
91
|
-
declare const
|
|
84
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
92
85
|
|
|
93
|
-
declare const
|
|
86
|
+
declare const prettier: FlatESLintConfig[];
|
|
94
87
|
|
|
95
|
-
declare const
|
|
88
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
96
89
|
|
|
97
|
-
declare const
|
|
90
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
98
91
|
|
|
99
|
-
declare const
|
|
92
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
93
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
100
94
|
|
|
101
|
-
declare const
|
|
102
|
-
|
|
103
|
-
declare const javascript: FlatESLintConfigItem[];
|
|
104
|
-
declare const jsx: FlatESLintConfigItem[];
|
|
105
|
-
|
|
106
|
-
declare const typescript: FlatESLintConfigItem[];
|
|
95
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
107
96
|
|
|
108
97
|
/**
|
|
109
98
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
110
99
|
*/
|
|
111
|
-
declare const ignores:
|
|
100
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
112
101
|
|
|
113
|
-
export { GLOB_ALL_SRC,
|
|
102
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, common, getVueVersion, ignores, imports, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, sortPackageJson, sortTsConfig, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ var GLOB_JSON = "**/*.json";
|
|
|
13
13
|
var GLOB_JSON5 = "**/*.json5";
|
|
14
14
|
var GLOB_JSONC = "**/*.jsonc";
|
|
15
15
|
var GLOB_VUE = "**/*.vue";
|
|
16
|
-
var GLOB_ASTRO = "**/*.astro";
|
|
17
16
|
var GLOB_MARKDOWN = "**/*.md";
|
|
18
17
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
19
18
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -58,33 +57,34 @@ var GLOB_EXCLUDE = [
|
|
|
58
57
|
"**/.yarnrc"
|
|
59
58
|
];
|
|
60
59
|
|
|
60
|
+
// src/presets.ts
|
|
61
|
+
import { defineFlatConfig as defineFlatConfig15 } from "eslint-define-config";
|
|
62
|
+
|
|
61
63
|
// src/configs/vue.ts
|
|
62
64
|
import process from "node:process";
|
|
63
65
|
import { getPackageInfoSync } from "local-pkg";
|
|
66
|
+
import { defineFlatConfig as defineFlatConfig2 } from "eslint-define-config";
|
|
64
67
|
|
|
65
68
|
// src/plugins.ts
|
|
66
69
|
import * as pluginYaml from "eslint-plugin-yml";
|
|
67
|
-
import * as pluginAstro from "eslint-plugin-astro";
|
|
68
70
|
import { default as default2 } from "eslint-plugin-n";
|
|
69
71
|
import { default as default3 } from "eslint-plugin-i";
|
|
70
72
|
import { default as default4 } from "eslint-plugin-vue";
|
|
71
73
|
import { default as default5 } from "eslint-plugin-jsonc";
|
|
72
|
-
import { default as default6 } from "eslint-plugin
|
|
73
|
-
import { default as default7 } from "
|
|
74
|
-
import { default as default8 } from "eslint-plugin-
|
|
75
|
-
import { default as default9 } from "eslint-plugin-
|
|
76
|
-
import { default as default10 } from "eslint-plugin-
|
|
77
|
-
import { default as default11 } from "eslint-plugin
|
|
78
|
-
import { default as default12 } from "
|
|
79
|
-
import { default as default13 } from "
|
|
80
|
-
import { default as default14 } from "
|
|
81
|
-
import { default as default15 } from "vue-eslint-parser";
|
|
82
|
-
import { default as default16 } from "jsonc-eslint-parser";
|
|
83
|
-
import { default as default17 } from "astro-eslint-parser";
|
|
74
|
+
import { default as default6 } from "@unocss/eslint-plugin";
|
|
75
|
+
import { default as default7 } from "eslint-plugin-unicorn";
|
|
76
|
+
import { default as default8 } from "eslint-plugin-prettier";
|
|
77
|
+
import { default as default9 } from "eslint-plugin-markdown";
|
|
78
|
+
import { default as default10 } from "eslint-plugin-eslint-comments";
|
|
79
|
+
import { default as default11 } from "@typescript-eslint/eslint-plugin";
|
|
80
|
+
import { default as default12 } from "yaml-eslint-parser";
|
|
81
|
+
import { default as default13 } from "vue-eslint-parser";
|
|
82
|
+
import { default as default14 } from "jsonc-eslint-parser";
|
|
84
83
|
import * as parserTs from "@typescript-eslint/parser";
|
|
85
84
|
|
|
86
85
|
// src/configs/typescript.ts
|
|
87
|
-
|
|
86
|
+
import { defineFlatConfig } from "eslint-define-config";
|
|
87
|
+
var typescript = defineFlatConfig([
|
|
88
88
|
{
|
|
89
89
|
files: [GLOB_TS, GLOB_TSX],
|
|
90
90
|
languageOptions: {
|
|
@@ -94,11 +94,11 @@ var typescript = [
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
plugins: {
|
|
97
|
-
"@typescript-eslint":
|
|
97
|
+
"@typescript-eslint": default11
|
|
98
98
|
},
|
|
99
99
|
rules: {
|
|
100
|
-
...
|
|
101
|
-
...
|
|
100
|
+
...default11.configs.recommended.rules,
|
|
101
|
+
...default11.configs.stylistic.rules,
|
|
102
102
|
"@typescript-eslint/no-unused-vars": "error",
|
|
103
103
|
"@typescript-eslint/no-redeclare": "error",
|
|
104
104
|
"@typescript-eslint/consistent-type-imports": [
|
|
@@ -155,7 +155,7 @@ var typescript = [
|
|
|
155
155
|
"@typescript-eslint/no-var-requires": "off"
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
];
|
|
158
|
+
]);
|
|
159
159
|
|
|
160
160
|
// src/configs/vue.ts
|
|
161
161
|
function getVueVersion() {
|
|
@@ -173,15 +173,15 @@ var vue2Rules = {
|
|
|
173
173
|
var vue3Rules = {
|
|
174
174
|
...vueBaseRules
|
|
175
175
|
};
|
|
176
|
-
var vue = [
|
|
176
|
+
var vue = defineFlatConfig2([
|
|
177
177
|
{
|
|
178
178
|
files: [GLOB_VUE],
|
|
179
179
|
plugins: {
|
|
180
180
|
vue: default4,
|
|
181
|
-
"@typescript-eslint":
|
|
181
|
+
"@typescript-eslint": default11
|
|
182
182
|
},
|
|
183
183
|
languageOptions: {
|
|
184
|
-
parser:
|
|
184
|
+
parser: default13,
|
|
185
185
|
parserOptions: {
|
|
186
186
|
parser: "@typescript-eslint/parser",
|
|
187
187
|
sourceType: "module",
|
|
@@ -202,14 +202,15 @@ var vue = [
|
|
|
202
202
|
},
|
|
203
203
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
204
204
|
}
|
|
205
|
-
];
|
|
205
|
+
]);
|
|
206
206
|
|
|
207
207
|
// src/configs/yml.ts
|
|
208
|
-
|
|
208
|
+
import { defineFlatConfig as defineFlatConfig3 } from "eslint-define-config";
|
|
209
|
+
var yml = defineFlatConfig3([
|
|
209
210
|
{
|
|
210
211
|
files: [GLOB_YAML],
|
|
211
212
|
languageOptions: {
|
|
212
|
-
parser:
|
|
213
|
+
parser: default12
|
|
213
214
|
},
|
|
214
215
|
plugins: {
|
|
215
216
|
yml: pluginYaml
|
|
@@ -221,10 +222,11 @@ var yml = [
|
|
|
221
222
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
|
-
];
|
|
225
|
+
]);
|
|
225
226
|
|
|
226
227
|
// src/configs/node.ts
|
|
227
|
-
|
|
228
|
+
import { defineFlatConfig as defineFlatConfig4 } from "eslint-define-config";
|
|
229
|
+
var node = defineFlatConfig4([
|
|
228
230
|
{
|
|
229
231
|
plugins: {
|
|
230
232
|
node: default2
|
|
@@ -240,10 +242,11 @@ var node = [
|
|
|
240
242
|
"node/process-exit-as-throw": "error"
|
|
241
243
|
}
|
|
242
244
|
}
|
|
243
|
-
];
|
|
245
|
+
]);
|
|
244
246
|
|
|
245
247
|
// src/configs/sort.ts
|
|
246
|
-
|
|
248
|
+
import { defineFlatConfig as defineFlatConfig5 } from "eslint-define-config";
|
|
249
|
+
var sortPackageJson = defineFlatConfig5([
|
|
247
250
|
{
|
|
248
251
|
files: ["**/package.json"],
|
|
249
252
|
rules: {
|
|
@@ -320,8 +323,8 @@ var sortPackageJson = [
|
|
|
320
323
|
]
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
|
-
];
|
|
324
|
-
var sortTsConfig = [
|
|
326
|
+
]);
|
|
327
|
+
var sortTsConfig = defineFlatConfig5([
|
|
325
328
|
{
|
|
326
329
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
327
330
|
rules: {
|
|
@@ -435,66 +438,18 @@ var sortTsConfig = [
|
|
|
435
438
|
]
|
|
436
439
|
}
|
|
437
440
|
}
|
|
438
|
-
];
|
|
439
|
-
|
|
440
|
-
// src/configs/react.ts
|
|
441
|
-
var react = [
|
|
442
|
-
{
|
|
443
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
444
|
-
plugins: {
|
|
445
|
-
react: default6,
|
|
446
|
-
"react-hooks": default11
|
|
447
|
-
},
|
|
448
|
-
settings: {
|
|
449
|
-
react: {
|
|
450
|
-
version: "18.0"
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
languageOptions: {
|
|
454
|
-
parserOptions: {
|
|
455
|
-
ecmaFeatures: {
|
|
456
|
-
jsx: true
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
rules: {
|
|
461
|
-
...default6.configs.recommended.rules,
|
|
462
|
-
...default11.configs.recommended.rules,
|
|
463
|
-
"jsx-quotes": ["error", "prefer-double"],
|
|
464
|
-
"react/react-in-jsx-scope": "off"
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
];
|
|
468
|
-
|
|
469
|
-
// src/configs/astro.ts
|
|
470
|
-
var astro = [
|
|
471
|
-
{
|
|
472
|
-
files: [GLOB_ASTRO],
|
|
473
|
-
plugins: {
|
|
474
|
-
astro: pluginAstro
|
|
475
|
-
},
|
|
476
|
-
languageOptions: {
|
|
477
|
-
parser: default17,
|
|
478
|
-
parserOptions: {
|
|
479
|
-
parser: "@typescript-eslint/parser",
|
|
480
|
-
extraFileExtensions: [".astro"]
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
rules: {
|
|
484
|
-
...pluginAstro.configs.recommended.rules
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
];
|
|
441
|
+
]);
|
|
488
442
|
|
|
489
443
|
// src/configs/jsonc.ts
|
|
490
|
-
|
|
444
|
+
import { defineFlatConfig as defineFlatConfig6 } from "eslint-define-config";
|
|
445
|
+
var jsonc = defineFlatConfig6([
|
|
491
446
|
{
|
|
492
447
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
493
448
|
plugins: {
|
|
494
449
|
jsonc: default5
|
|
495
450
|
},
|
|
496
451
|
languageOptions: {
|
|
497
|
-
parser:
|
|
452
|
+
parser: default14
|
|
498
453
|
},
|
|
499
454
|
rules: {
|
|
500
455
|
...default5.configs["recommended-with-jsonc"].rules,
|
|
@@ -526,10 +481,11 @@ var jsonc = [
|
|
|
526
481
|
]
|
|
527
482
|
}
|
|
528
483
|
}
|
|
529
|
-
];
|
|
484
|
+
]);
|
|
530
485
|
|
|
531
486
|
// src/configs/imports.ts
|
|
532
|
-
|
|
487
|
+
import { defineFlatConfig as defineFlatConfig7 } from "eslint-define-config";
|
|
488
|
+
var imports = defineFlatConfig7([
|
|
533
489
|
{
|
|
534
490
|
plugins: {
|
|
535
491
|
import: default3
|
|
@@ -568,25 +524,27 @@ var imports = [
|
|
|
568
524
|
]
|
|
569
525
|
}
|
|
570
526
|
}
|
|
571
|
-
];
|
|
527
|
+
]);
|
|
572
528
|
|
|
573
529
|
// src/configs/unocss.ts
|
|
574
|
-
|
|
530
|
+
import { defineFlatConfig as defineFlatConfig8 } from "eslint-define-config";
|
|
531
|
+
var unocss = defineFlatConfig8([
|
|
575
532
|
{
|
|
576
533
|
plugins: {
|
|
577
|
-
"@unocss":
|
|
534
|
+
"@unocss": default6
|
|
578
535
|
},
|
|
579
536
|
rules: {
|
|
580
|
-
...
|
|
537
|
+
...default6.configs.recommended.rules
|
|
581
538
|
}
|
|
582
539
|
}
|
|
583
|
-
];
|
|
540
|
+
]);
|
|
584
541
|
|
|
585
542
|
// src/configs/unicorn.ts
|
|
586
|
-
|
|
543
|
+
import { defineFlatConfig as defineFlatConfig9 } from "eslint-define-config";
|
|
544
|
+
var unicorn = defineFlatConfig9([
|
|
587
545
|
{
|
|
588
546
|
plugins: {
|
|
589
|
-
unicorn:
|
|
547
|
+
unicorn: default7
|
|
590
548
|
},
|
|
591
549
|
rules: {
|
|
592
550
|
"unicorn/no-unsafe-regex": "off",
|
|
@@ -655,29 +613,31 @@ var unicorn = [
|
|
|
655
613
|
"unicorn/prefer-array-index-of": "error"
|
|
656
614
|
}
|
|
657
615
|
}
|
|
658
|
-
];
|
|
616
|
+
]);
|
|
659
617
|
|
|
660
618
|
// src/configs/prettier.ts
|
|
661
619
|
import prettierConfig from "eslint-config-prettier";
|
|
662
|
-
|
|
620
|
+
import { defineFlatConfig as defineFlatConfig10 } from "eslint-define-config";
|
|
621
|
+
var prettier = defineFlatConfig10([
|
|
663
622
|
{
|
|
664
623
|
plugins: {
|
|
665
|
-
prettier:
|
|
624
|
+
prettier: default8
|
|
666
625
|
},
|
|
667
626
|
rules: {
|
|
668
627
|
...prettierConfig.rules,
|
|
669
|
-
...
|
|
628
|
+
...default8.configs.recommended.rules,
|
|
670
629
|
"prettier/prettier": "warn"
|
|
671
630
|
}
|
|
672
631
|
}
|
|
673
|
-
];
|
|
632
|
+
]);
|
|
674
633
|
|
|
675
634
|
// src/configs/markdown.ts
|
|
676
|
-
|
|
635
|
+
import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
|
|
636
|
+
var markdown = defineFlatConfig11([
|
|
677
637
|
{
|
|
678
638
|
files: [GLOB_MARKDOWN],
|
|
679
639
|
plugins: {
|
|
680
|
-
markdown:
|
|
640
|
+
markdown: default9
|
|
681
641
|
},
|
|
682
642
|
processor: "markdown/markdown"
|
|
683
643
|
},
|
|
@@ -691,10 +651,10 @@ var markdown = [
|
|
|
691
651
|
}
|
|
692
652
|
},
|
|
693
653
|
plugins: {
|
|
694
|
-
"@typescript-eslint":
|
|
654
|
+
"@typescript-eslint": default11
|
|
695
655
|
},
|
|
696
656
|
rules: {
|
|
697
|
-
...
|
|
657
|
+
...default9.configs.recommended.overrides[1].rules,
|
|
698
658
|
"no-undef": "off",
|
|
699
659
|
"no-alert": "off",
|
|
700
660
|
"no-console": "off",
|
|
@@ -712,25 +672,27 @@ var markdown = [
|
|
|
712
672
|
"unused-imports/no-unused-vars": "off"
|
|
713
673
|
}
|
|
714
674
|
}
|
|
715
|
-
];
|
|
675
|
+
]);
|
|
716
676
|
|
|
717
677
|
// src/configs/comments.ts
|
|
718
|
-
|
|
678
|
+
import { defineFlatConfig as defineFlatConfig12 } from "eslint-define-config";
|
|
679
|
+
var comments = defineFlatConfig12([
|
|
719
680
|
{
|
|
720
681
|
plugins: {
|
|
721
|
-
"eslint-comments":
|
|
682
|
+
"eslint-comments": default10
|
|
722
683
|
},
|
|
723
684
|
rules: {
|
|
724
|
-
...
|
|
685
|
+
...default10.configs.recommended.rules,
|
|
725
686
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
726
687
|
}
|
|
727
688
|
}
|
|
728
|
-
];
|
|
689
|
+
]);
|
|
729
690
|
|
|
730
691
|
// src/configs/javascript.ts
|
|
731
692
|
import globals from "globals";
|
|
732
693
|
import jsConfig from "@eslint/js";
|
|
733
|
-
|
|
694
|
+
import { defineFlatConfig as defineFlatConfig13 } from "eslint-define-config";
|
|
695
|
+
var javascript = defineFlatConfig13([
|
|
734
696
|
jsConfig.configs.recommended,
|
|
735
697
|
{
|
|
736
698
|
languageOptions: {
|
|
@@ -1091,8 +1053,8 @@ var javascript = [
|
|
|
1091
1053
|
"max-lines-per-function": "off"
|
|
1092
1054
|
}
|
|
1093
1055
|
}
|
|
1094
|
-
];
|
|
1095
|
-
var jsx = [
|
|
1056
|
+
]);
|
|
1057
|
+
var jsx = defineFlatConfig13([
|
|
1096
1058
|
{
|
|
1097
1059
|
files: ["**/*.jsx"],
|
|
1098
1060
|
languageOptions: {
|
|
@@ -1103,17 +1065,18 @@ var jsx = [
|
|
|
1103
1065
|
}
|
|
1104
1066
|
}
|
|
1105
1067
|
}
|
|
1106
|
-
];
|
|
1068
|
+
]);
|
|
1107
1069
|
|
|
1108
1070
|
// src/configs/ignores.ts
|
|
1109
|
-
|
|
1071
|
+
import { defineFlatConfig as defineFlatConfig14 } from "eslint-define-config";
|
|
1072
|
+
var ignores = defineFlatConfig14([
|
|
1110
1073
|
{
|
|
1111
1074
|
ignores: GLOB_EXCLUDE
|
|
1112
1075
|
}
|
|
1113
|
-
];
|
|
1076
|
+
]);
|
|
1114
1077
|
|
|
1115
1078
|
// src/presets.ts
|
|
1116
|
-
var basic = [
|
|
1079
|
+
var basic = defineFlatConfig15([
|
|
1117
1080
|
...ignores,
|
|
1118
1081
|
...javascript,
|
|
1119
1082
|
...jsx,
|
|
@@ -1122,8 +1085,8 @@ var basic = [
|
|
|
1122
1085
|
...imports,
|
|
1123
1086
|
...unicorn,
|
|
1124
1087
|
...comments
|
|
1125
|
-
];
|
|
1126
|
-
var common = [
|
|
1088
|
+
]);
|
|
1089
|
+
var common = defineFlatConfig15([
|
|
1127
1090
|
...basic,
|
|
1128
1091
|
...yml,
|
|
1129
1092
|
...jsonc,
|
|
@@ -1131,24 +1094,13 @@ var common = [
|
|
|
1131
1094
|
...sortTsConfig,
|
|
1132
1095
|
...prettier,
|
|
1133
1096
|
...markdown
|
|
1134
|
-
];
|
|
1135
|
-
var all = [...common, ...vue, ...
|
|
1136
|
-
function ntnyq(config = [], {
|
|
1137
|
-
|
|
1138
|
-
react: enableReact = false,
|
|
1139
|
-
astro: enableAstro = false,
|
|
1140
|
-
unocss: enableUnoCSS = false
|
|
1141
|
-
} = {}) {
|
|
1142
|
-
const configs = [...common];
|
|
1097
|
+
]);
|
|
1098
|
+
var all = defineFlatConfig15([...common, ...vue, ...unocss]);
|
|
1099
|
+
function ntnyq(config = [], { vue: enableVue = false, unocss: enableUnoCSS = false } = {}) {
|
|
1100
|
+
const configs = defineFlatConfig15([...common]);
|
|
1143
1101
|
if (enableVue) {
|
|
1144
1102
|
configs.push(...vue);
|
|
1145
1103
|
}
|
|
1146
|
-
if (enableReact) {
|
|
1147
|
-
configs.push(...react);
|
|
1148
|
-
}
|
|
1149
|
-
if (enableAstro) {
|
|
1150
|
-
configs.push(...astro);
|
|
1151
|
-
}
|
|
1152
1104
|
if (enableUnoCSS) {
|
|
1153
1105
|
configs.push(...unocss);
|
|
1154
1106
|
}
|
|
@@ -1159,7 +1111,6 @@ function ntnyq(config = [], {
|
|
|
1159
1111
|
}
|
|
1160
1112
|
export {
|
|
1161
1113
|
GLOB_ALL_SRC,
|
|
1162
|
-
GLOB_ASTRO,
|
|
1163
1114
|
GLOB_CSS,
|
|
1164
1115
|
GLOB_DIST,
|
|
1165
1116
|
GLOB_EXCLUDE,
|
|
@@ -1182,7 +1133,6 @@ export {
|
|
|
1182
1133
|
GLOB_VUE,
|
|
1183
1134
|
GLOB_YAML,
|
|
1184
1135
|
all,
|
|
1185
|
-
astro,
|
|
1186
1136
|
basic,
|
|
1187
1137
|
comments,
|
|
1188
1138
|
common,
|
|
@@ -1195,27 +1145,22 @@ export {
|
|
|
1195
1145
|
markdown,
|
|
1196
1146
|
node,
|
|
1197
1147
|
ntnyq,
|
|
1198
|
-
|
|
1199
|
-
default16 as parserJsonc,
|
|
1148
|
+
default14 as parserJsonc,
|
|
1200
1149
|
parserTs,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
default12 as pluginComments,
|
|
1150
|
+
default13 as parserVue,
|
|
1151
|
+
default12 as parserYaml,
|
|
1152
|
+
default10 as pluginComments,
|
|
1205
1153
|
default3 as pluginImport,
|
|
1206
1154
|
default5 as pluginJsonc,
|
|
1207
|
-
|
|
1155
|
+
default9 as pluginMarkdown,
|
|
1208
1156
|
default2 as pluginNode,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
default8 as pluginUnicorn,
|
|
1214
|
-
default7 as pluginUnoCSS,
|
|
1157
|
+
default8 as pluginPrettier,
|
|
1158
|
+
default11 as pluginTs,
|
|
1159
|
+
default7 as pluginUnicorn,
|
|
1160
|
+
default6 as pluginUnoCSS,
|
|
1215
1161
|
default4 as pluginVue,
|
|
1216
1162
|
pluginYaml,
|
|
1217
1163
|
prettier,
|
|
1218
|
-
react,
|
|
1219
1164
|
sortPackageJson,
|
|
1220
1165
|
sortTsConfig,
|
|
1221
1166
|
typescript,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.23",
|
|
5
5
|
"description": "ESLint flat config of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -48,45 +48,41 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"eslint": "^8.
|
|
51
|
+
"eslint": "^8.50.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@eslint/js": "^8.
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
56
|
-
"@typescript-eslint/parser": "^6.
|
|
57
|
-
"@unocss/eslint-plugin": "^0.
|
|
58
|
-
"
|
|
59
|
-
"eslint-config
|
|
60
|
-
"eslint-define-config": "^1.24.1",
|
|
61
|
-
"eslint-plugin-astro": "^0.29.1",
|
|
54
|
+
"@eslint/js": "^8.55.0",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
|
56
|
+
"@typescript-eslint/parser": "^6.13.1",
|
|
57
|
+
"@unocss/eslint-plugin": "^0.58.0",
|
|
58
|
+
"eslint-config-prettier": "^9.1.0",
|
|
59
|
+
"eslint-define-config": "^2.0.0",
|
|
62
60
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
63
|
-
"eslint-plugin-i": "^2.
|
|
61
|
+
"eslint-plugin-i": "^2.29.0",
|
|
64
62
|
"eslint-plugin-jsonc": "^2.10.0",
|
|
65
63
|
"eslint-plugin-markdown": "^3.0.1",
|
|
66
|
-
"eslint-plugin-n": "^16.
|
|
64
|
+
"eslint-plugin-n": "^16.3.1",
|
|
67
65
|
"eslint-plugin-prettier": "^5.0.1",
|
|
68
|
-
"eslint-plugin-
|
|
69
|
-
"eslint-plugin-
|
|
70
|
-
"eslint-plugin-unicorn": "^48.0.1",
|
|
71
|
-
"eslint-plugin-vue": "^9.17.0",
|
|
66
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
67
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
72
68
|
"eslint-plugin-yml": "^1.10.0",
|
|
73
69
|
"globals": "^13.23.0",
|
|
74
|
-
"jsonc-eslint-parser": "^2.
|
|
70
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
75
71
|
"local-pkg": "^0.5.0",
|
|
76
|
-
"prettier": "^3.0
|
|
72
|
+
"prettier": "^3.1.0",
|
|
77
73
|
"vue-eslint-parser": "^9.3.2",
|
|
78
74
|
"yaml-eslint-parser": "^1.2.2"
|
|
79
75
|
},
|
|
80
76
|
"devDependencies": {
|
|
81
|
-
"@ntnyq/prettier-config": "^1.
|
|
82
|
-
"@types/node": "^20.
|
|
77
|
+
"@ntnyq/prettier-config": "^1.19.0",
|
|
78
|
+
"@types/node": "^20.10.3",
|
|
83
79
|
"bumpp": "^9.2.0",
|
|
84
|
-
"eslint": "^8.
|
|
80
|
+
"eslint": "^8.55.0",
|
|
85
81
|
"husky": "^8.0.3",
|
|
86
82
|
"nano-staged": "^0.8.0",
|
|
87
83
|
"npm-run-all": "^4.1.5",
|
|
88
84
|
"rimraf": "^5.0.5",
|
|
89
|
-
"tsup": "^
|
|
85
|
+
"tsup": "^8.0.1",
|
|
90
86
|
"typescript": "5.2.2"
|
|
91
87
|
},
|
|
92
88
|
"engines": {
|