@ntnyq/eslint-config 2.0.0-beta.20 → 2.0.0-beta.22
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 +83 -66
- package/dist/index.d.cts +33 -29
- package/dist/index.d.ts +33 -29
- package/dist/index.js +134 -117
- package/package.json +26 -26
package/dist/index.cjs
CHANGED
|
@@ -69,10 +69,10 @@ __export(src_exports, {
|
|
|
69
69
|
ntnyq: () => ntnyq,
|
|
70
70
|
parserAstro: () => import_astro_eslint_parser.default,
|
|
71
71
|
parserJsonc: () => import_jsonc_eslint_parser.default,
|
|
72
|
-
|
|
72
|
+
parserTs: () => parserTs,
|
|
73
73
|
parserVue: () => import_vue_eslint_parser.default,
|
|
74
|
-
|
|
75
|
-
pluginAstro: () =>
|
|
74
|
+
parserYaml: () => import_yaml_eslint_parser.default,
|
|
75
|
+
pluginAstro: () => pluginAstro,
|
|
76
76
|
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
77
77
|
pluginImport: () => import_eslint_plugin_i.default,
|
|
78
78
|
pluginJsonc: () => import_eslint_plugin_jsonc.default,
|
|
@@ -81,11 +81,11 @@ __export(src_exports, {
|
|
|
81
81
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
82
82
|
pluginReact: () => import_eslint_plugin_react.default,
|
|
83
83
|
pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
|
|
84
|
-
|
|
84
|
+
pluginTs: () => import_eslint_plugin2.default,
|
|
85
85
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
86
86
|
pluginUnoCSS: () => import_eslint_plugin.default,
|
|
87
87
|
pluginVue: () => import_eslint_plugin_vue.default,
|
|
88
|
-
|
|
88
|
+
pluginYaml: () => pluginYaml,
|
|
89
89
|
prettier: () => prettier,
|
|
90
90
|
react: () => react,
|
|
91
91
|
sortPackageJson: () => sortPackageJson,
|
|
@@ -158,23 +158,20 @@ var GLOB_EXCLUDE = [
|
|
|
158
158
|
"**/.yarnrc"
|
|
159
159
|
];
|
|
160
160
|
|
|
161
|
+
// src/presets.ts
|
|
162
|
+
var import_eslint_define_config17 = require("eslint-define-config");
|
|
163
|
+
|
|
161
164
|
// src/configs/vue.ts
|
|
162
165
|
var import_node_process = __toESM(require("process"), 1);
|
|
163
166
|
var import_local_pkg = require("local-pkg");
|
|
164
|
-
|
|
165
|
-
// src/parsers.ts
|
|
166
|
-
var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
|
|
167
|
-
var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
|
|
168
|
-
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
169
|
-
var import_astro_eslint_parser = __toESM(require("astro-eslint-parser"), 1);
|
|
170
|
-
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
167
|
+
var import_eslint_define_config2 = require("eslint-define-config");
|
|
171
168
|
|
|
172
169
|
// src/plugins.ts
|
|
170
|
+
var pluginYaml = __toESM(require("eslint-plugin-yml"), 1);
|
|
171
|
+
var pluginAstro = __toESM(require("eslint-plugin-astro"), 1);
|
|
173
172
|
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
174
173
|
var import_eslint_plugin_i = __toESM(require("eslint-plugin-i"), 1);
|
|
175
|
-
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
176
174
|
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
177
|
-
var import_eslint_plugin_astro = __toESM(require("eslint-plugin-astro"), 1);
|
|
178
175
|
var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
179
176
|
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
|
180
177
|
var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
@@ -184,13 +181,19 @@ var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1
|
|
|
184
181
|
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
|
185
182
|
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
186
183
|
var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
184
|
+
var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
|
|
185
|
+
var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
|
|
186
|
+
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
187
|
+
var import_astro_eslint_parser = __toESM(require("astro-eslint-parser"), 1);
|
|
188
|
+
var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
|
|
187
189
|
|
|
188
190
|
// src/configs/typescript.ts
|
|
189
|
-
var
|
|
191
|
+
var import_eslint_define_config = require("eslint-define-config");
|
|
192
|
+
var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
190
193
|
{
|
|
191
194
|
files: [GLOB_TS, GLOB_TSX],
|
|
192
195
|
languageOptions: {
|
|
193
|
-
parser:
|
|
196
|
+
parser: parserTs,
|
|
194
197
|
parserOptions: {
|
|
195
198
|
sourceType: "module"
|
|
196
199
|
}
|
|
@@ -257,7 +260,7 @@ var typescript = [
|
|
|
257
260
|
"@typescript-eslint/no-var-requires": "off"
|
|
258
261
|
}
|
|
259
262
|
}
|
|
260
|
-
];
|
|
263
|
+
]);
|
|
261
264
|
|
|
262
265
|
// src/configs/vue.ts
|
|
263
266
|
function getVueVersion() {
|
|
@@ -275,7 +278,7 @@ var vue2Rules = {
|
|
|
275
278
|
var vue3Rules = {
|
|
276
279
|
...vueBaseRules
|
|
277
280
|
};
|
|
278
|
-
var vue = [
|
|
281
|
+
var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
279
282
|
{
|
|
280
283
|
files: [GLOB_VUE],
|
|
281
284
|
plugins: {
|
|
@@ -304,29 +307,31 @@ var vue = [
|
|
|
304
307
|
},
|
|
305
308
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
306
309
|
}
|
|
307
|
-
];
|
|
310
|
+
]);
|
|
308
311
|
|
|
309
312
|
// src/configs/yml.ts
|
|
310
|
-
var
|
|
313
|
+
var import_eslint_define_config3 = require("eslint-define-config");
|
|
314
|
+
var yml = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
311
315
|
{
|
|
312
316
|
files: [GLOB_YAML],
|
|
313
317
|
languageOptions: {
|
|
314
318
|
parser: import_yaml_eslint_parser.default
|
|
315
319
|
},
|
|
316
320
|
plugins: {
|
|
317
|
-
yml:
|
|
321
|
+
yml: pluginYaml
|
|
318
322
|
},
|
|
319
323
|
rules: {
|
|
320
|
-
...
|
|
321
|
-
...
|
|
324
|
+
...pluginYaml.configs.standard.rules,
|
|
325
|
+
...pluginYaml.configs.prettier.rules,
|
|
322
326
|
"yml/no-empty-mapping-value": "off",
|
|
323
327
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
|
-
];
|
|
330
|
+
]);
|
|
327
331
|
|
|
328
332
|
// src/configs/node.ts
|
|
329
|
-
var
|
|
333
|
+
var import_eslint_define_config4 = require("eslint-define-config");
|
|
334
|
+
var node = (0, import_eslint_define_config4.defineFlatConfig)([
|
|
330
335
|
{
|
|
331
336
|
plugins: {
|
|
332
337
|
node: import_eslint_plugin_n.default
|
|
@@ -342,10 +347,11 @@ var node = [
|
|
|
342
347
|
"node/process-exit-as-throw": "error"
|
|
343
348
|
}
|
|
344
349
|
}
|
|
345
|
-
];
|
|
350
|
+
]);
|
|
346
351
|
|
|
347
352
|
// src/configs/sort.ts
|
|
348
|
-
var
|
|
353
|
+
var import_eslint_define_config5 = require("eslint-define-config");
|
|
354
|
+
var sortPackageJson = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
349
355
|
{
|
|
350
356
|
files: ["**/package.json"],
|
|
351
357
|
rules: {
|
|
@@ -422,8 +428,8 @@ var sortPackageJson = [
|
|
|
422
428
|
]
|
|
423
429
|
}
|
|
424
430
|
}
|
|
425
|
-
];
|
|
426
|
-
var sortTsConfig = [
|
|
431
|
+
]);
|
|
432
|
+
var sortTsConfig = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
427
433
|
{
|
|
428
434
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
429
435
|
rules: {
|
|
@@ -537,10 +543,11 @@ var sortTsConfig = [
|
|
|
537
543
|
]
|
|
538
544
|
}
|
|
539
545
|
}
|
|
540
|
-
];
|
|
546
|
+
]);
|
|
541
547
|
|
|
542
548
|
// src/configs/react.ts
|
|
543
|
-
var
|
|
549
|
+
var import_eslint_define_config6 = require("eslint-define-config");
|
|
550
|
+
var react = (0, import_eslint_define_config6.defineFlatConfig)([
|
|
544
551
|
{
|
|
545
552
|
files: [GLOB_JSX, GLOB_TSX],
|
|
546
553
|
plugins: {
|
|
@@ -566,14 +573,15 @@ var react = [
|
|
|
566
573
|
"react/react-in-jsx-scope": "off"
|
|
567
574
|
}
|
|
568
575
|
}
|
|
569
|
-
];
|
|
576
|
+
]);
|
|
570
577
|
|
|
571
578
|
// src/configs/astro.ts
|
|
572
|
-
var
|
|
579
|
+
var import_eslint_define_config7 = require("eslint-define-config");
|
|
580
|
+
var astro = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
573
581
|
{
|
|
574
582
|
files: [GLOB_ASTRO],
|
|
575
583
|
plugins: {
|
|
576
|
-
astro:
|
|
584
|
+
astro: pluginAstro
|
|
577
585
|
},
|
|
578
586
|
languageOptions: {
|
|
579
587
|
parser: import_astro_eslint_parser.default,
|
|
@@ -583,13 +591,14 @@ var astro = [
|
|
|
583
591
|
}
|
|
584
592
|
},
|
|
585
593
|
rules: {
|
|
586
|
-
...
|
|
594
|
+
...pluginAstro.configs.recommended.rules
|
|
587
595
|
}
|
|
588
596
|
}
|
|
589
|
-
];
|
|
597
|
+
]);
|
|
590
598
|
|
|
591
599
|
// src/configs/jsonc.ts
|
|
592
|
-
var
|
|
600
|
+
var import_eslint_define_config8 = require("eslint-define-config");
|
|
601
|
+
var jsonc = (0, import_eslint_define_config8.defineFlatConfig)([
|
|
593
602
|
{
|
|
594
603
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
595
604
|
plugins: {
|
|
@@ -628,10 +637,11 @@ var jsonc = [
|
|
|
628
637
|
]
|
|
629
638
|
}
|
|
630
639
|
}
|
|
631
|
-
];
|
|
640
|
+
]);
|
|
632
641
|
|
|
633
642
|
// src/configs/imports.ts
|
|
634
|
-
var
|
|
643
|
+
var import_eslint_define_config9 = require("eslint-define-config");
|
|
644
|
+
var imports = (0, import_eslint_define_config9.defineFlatConfig)([
|
|
635
645
|
{
|
|
636
646
|
plugins: {
|
|
637
647
|
import: import_eslint_plugin_i.default
|
|
@@ -670,10 +680,11 @@ var imports = [
|
|
|
670
680
|
]
|
|
671
681
|
}
|
|
672
682
|
}
|
|
673
|
-
];
|
|
683
|
+
]);
|
|
674
684
|
|
|
675
685
|
// src/configs/unocss.ts
|
|
676
|
-
var
|
|
686
|
+
var import_eslint_define_config10 = require("eslint-define-config");
|
|
687
|
+
var unocss = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
677
688
|
{
|
|
678
689
|
plugins: {
|
|
679
690
|
"@unocss": import_eslint_plugin.default
|
|
@@ -682,10 +693,11 @@ var unocss = [
|
|
|
682
693
|
...import_eslint_plugin.default.configs.recommended.rules
|
|
683
694
|
}
|
|
684
695
|
}
|
|
685
|
-
];
|
|
696
|
+
]);
|
|
686
697
|
|
|
687
698
|
// src/configs/unicorn.ts
|
|
688
|
-
var
|
|
699
|
+
var import_eslint_define_config11 = require("eslint-define-config");
|
|
700
|
+
var unicorn = (0, import_eslint_define_config11.defineFlatConfig)([
|
|
689
701
|
{
|
|
690
702
|
plugins: {
|
|
691
703
|
unicorn: import_eslint_plugin_unicorn.default
|
|
@@ -757,11 +769,12 @@ var unicorn = [
|
|
|
757
769
|
"unicorn/prefer-array-index-of": "error"
|
|
758
770
|
}
|
|
759
771
|
}
|
|
760
|
-
];
|
|
772
|
+
]);
|
|
761
773
|
|
|
762
774
|
// src/configs/prettier.ts
|
|
763
775
|
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
764
|
-
var
|
|
776
|
+
var import_eslint_define_config12 = require("eslint-define-config");
|
|
777
|
+
var prettier = (0, import_eslint_define_config12.defineFlatConfig)([
|
|
765
778
|
{
|
|
766
779
|
plugins: {
|
|
767
780
|
prettier: import_eslint_plugin_prettier.default
|
|
@@ -772,10 +785,11 @@ var prettier = [
|
|
|
772
785
|
"prettier/prettier": "warn"
|
|
773
786
|
}
|
|
774
787
|
}
|
|
775
|
-
];
|
|
788
|
+
]);
|
|
776
789
|
|
|
777
790
|
// src/configs/markdown.ts
|
|
778
|
-
var
|
|
791
|
+
var import_eslint_define_config13 = require("eslint-define-config");
|
|
792
|
+
var markdown = (0, import_eslint_define_config13.defineFlatConfig)([
|
|
779
793
|
{
|
|
780
794
|
files: [GLOB_MARKDOWN],
|
|
781
795
|
plugins: {
|
|
@@ -814,10 +828,11 @@ var markdown = [
|
|
|
814
828
|
"unused-imports/no-unused-vars": "off"
|
|
815
829
|
}
|
|
816
830
|
}
|
|
817
|
-
];
|
|
831
|
+
]);
|
|
818
832
|
|
|
819
833
|
// src/configs/comments.ts
|
|
820
|
-
var
|
|
834
|
+
var import_eslint_define_config14 = require("eslint-define-config");
|
|
835
|
+
var comments = (0, import_eslint_define_config14.defineFlatConfig)([
|
|
821
836
|
{
|
|
822
837
|
plugins: {
|
|
823
838
|
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
@@ -827,12 +842,13 @@ var comments = [
|
|
|
827
842
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
828
843
|
}
|
|
829
844
|
}
|
|
830
|
-
];
|
|
845
|
+
]);
|
|
831
846
|
|
|
832
847
|
// src/configs/javascript.ts
|
|
833
848
|
var import_globals = __toESM(require("globals"), 1);
|
|
834
849
|
var import_js = __toESM(require("@eslint/js"), 1);
|
|
835
|
-
var
|
|
850
|
+
var import_eslint_define_config15 = require("eslint-define-config");
|
|
851
|
+
var javascript = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
836
852
|
import_js.default.configs.recommended,
|
|
837
853
|
{
|
|
838
854
|
languageOptions: {
|
|
@@ -1193,8 +1209,8 @@ var javascript = [
|
|
|
1193
1209
|
"max-lines-per-function": "off"
|
|
1194
1210
|
}
|
|
1195
1211
|
}
|
|
1196
|
-
];
|
|
1197
|
-
var jsx = [
|
|
1212
|
+
]);
|
|
1213
|
+
var jsx = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
1198
1214
|
{
|
|
1199
1215
|
files: ["**/*.jsx"],
|
|
1200
1216
|
languageOptions: {
|
|
@@ -1205,17 +1221,18 @@ var jsx = [
|
|
|
1205
1221
|
}
|
|
1206
1222
|
}
|
|
1207
1223
|
}
|
|
1208
|
-
];
|
|
1224
|
+
]);
|
|
1209
1225
|
|
|
1210
1226
|
// src/configs/ignores.ts
|
|
1211
|
-
var
|
|
1227
|
+
var import_eslint_define_config16 = require("eslint-define-config");
|
|
1228
|
+
var ignores = (0, import_eslint_define_config16.defineFlatConfig)([
|
|
1212
1229
|
{
|
|
1213
1230
|
ignores: GLOB_EXCLUDE
|
|
1214
1231
|
}
|
|
1215
|
-
];
|
|
1232
|
+
]);
|
|
1216
1233
|
|
|
1217
1234
|
// src/presets.ts
|
|
1218
|
-
var basic = [
|
|
1235
|
+
var basic = (0, import_eslint_define_config17.defineFlatConfig)([
|
|
1219
1236
|
...ignores,
|
|
1220
1237
|
...javascript,
|
|
1221
1238
|
...jsx,
|
|
@@ -1224,8 +1241,8 @@ var basic = [
|
|
|
1224
1241
|
...imports,
|
|
1225
1242
|
...unicorn,
|
|
1226
1243
|
...comments
|
|
1227
|
-
];
|
|
1228
|
-
var common = [
|
|
1244
|
+
]);
|
|
1245
|
+
var common = (0, import_eslint_define_config17.defineFlatConfig)([
|
|
1229
1246
|
...basic,
|
|
1230
1247
|
...yml,
|
|
1231
1248
|
...jsonc,
|
|
@@ -1233,15 +1250,15 @@ var common = [
|
|
|
1233
1250
|
...sortTsConfig,
|
|
1234
1251
|
...prettier,
|
|
1235
1252
|
...markdown
|
|
1236
|
-
];
|
|
1237
|
-
var all = [...common, ...vue, ...react, ...astro, ...unocss];
|
|
1253
|
+
]);
|
|
1254
|
+
var all = (0, import_eslint_define_config17.defineFlatConfig)([...common, ...vue, ...react, ...astro, ...unocss]);
|
|
1238
1255
|
function ntnyq(config = [], {
|
|
1239
1256
|
vue: enableVue = false,
|
|
1240
1257
|
react: enableReact = false,
|
|
1241
1258
|
astro: enableAstro = false,
|
|
1242
1259
|
unocss: enableUnoCSS = false
|
|
1243
1260
|
} = {}) {
|
|
1244
|
-
const configs = [...common];
|
|
1261
|
+
const configs = (0, import_eslint_define_config17.defineFlatConfig)([...common]);
|
|
1245
1262
|
if (enableVue) {
|
|
1246
1263
|
configs.push(...vue);
|
|
1247
1264
|
}
|
|
@@ -1300,9 +1317,9 @@ function ntnyq(config = [], {
|
|
|
1300
1317
|
ntnyq,
|
|
1301
1318
|
parserAstro,
|
|
1302
1319
|
parserJsonc,
|
|
1303
|
-
|
|
1320
|
+
parserTs,
|
|
1304
1321
|
parserVue,
|
|
1305
|
-
|
|
1322
|
+
parserYaml,
|
|
1306
1323
|
pluginAstro,
|
|
1307
1324
|
pluginComments,
|
|
1308
1325
|
pluginImport,
|
|
@@ -1312,11 +1329,11 @@ function ntnyq(config = [], {
|
|
|
1312
1329
|
pluginPrettier,
|
|
1313
1330
|
pluginReact,
|
|
1314
1331
|
pluginReactHooks,
|
|
1315
|
-
|
|
1332
|
+
pluginTs,
|
|
1316
1333
|
pluginUnicorn,
|
|
1317
1334
|
pluginUnoCSS,
|
|
1318
1335
|
pluginVue,
|
|
1319
|
-
|
|
1336
|
+
pluginYaml,
|
|
1320
1337
|
prettier,
|
|
1321
1338
|
react,
|
|
1322
1339
|
sortPackageJson,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as eslint_define_config from 'eslint-define-config';
|
|
2
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
3
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
4
|
+
export { eslintPluginYml as pluginYaml };
|
|
5
|
+
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
6
|
+
export { eslintPluginAstro as pluginAstro };
|
|
2
7
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
3
8
|
export { default as pluginImport } from 'eslint-plugin-i';
|
|
4
|
-
export { default as pluginYml } from 'eslint-plugin-yml';
|
|
5
9
|
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
6
|
-
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
7
10
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
8
11
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
9
12
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
@@ -12,12 +15,13 @@ export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
|
12
15
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
13
16
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
14
17
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
18
|
+
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
19
|
+
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
17
20
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
18
21
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
19
22
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
20
|
-
|
|
23
|
+
import * as parser from '@typescript-eslint/parser';
|
|
24
|
+
export { parser as parserTs };
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* @file shared constants
|
|
@@ -53,58 +57,58 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
53
57
|
/**
|
|
54
58
|
* only js and ts
|
|
55
59
|
*/
|
|
56
|
-
declare const basic:
|
|
57
|
-
declare const common:
|
|
60
|
+
declare const basic: FlatESLintConfig[];
|
|
61
|
+
declare const common: FlatESLintConfig[];
|
|
58
62
|
/**
|
|
59
63
|
* all supported framework
|
|
60
64
|
*/
|
|
61
|
-
declare const all:
|
|
65
|
+
declare const all: FlatESLintConfig[];
|
|
62
66
|
/**
|
|
63
67
|
* custom framework support
|
|
64
68
|
*/
|
|
65
|
-
declare function ntnyq(config?:
|
|
69
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, react: enableReact, astro: enableAstro, unocss: enableUnoCSS, }?: {
|
|
66
70
|
vue?: boolean | undefined;
|
|
67
71
|
react?: boolean | undefined;
|
|
68
72
|
astro?: boolean | undefined;
|
|
69
73
|
unocss?: boolean | undefined;
|
|
70
|
-
}):
|
|
74
|
+
}): FlatESLintConfig[];
|
|
71
75
|
|
|
72
76
|
declare function getVueVersion(): number;
|
|
73
|
-
declare const vue:
|
|
77
|
+
declare const vue: FlatESLintConfig[];
|
|
74
78
|
|
|
75
|
-
declare const yml:
|
|
79
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
76
80
|
|
|
77
|
-
declare const node:
|
|
81
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
78
82
|
|
|
79
|
-
declare const sortPackageJson:
|
|
80
|
-
declare const sortTsConfig:
|
|
83
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
84
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
81
85
|
|
|
82
|
-
declare const react:
|
|
86
|
+
declare const react: eslint_define_config.FlatESLintConfig[];
|
|
83
87
|
|
|
84
|
-
declare const astro:
|
|
88
|
+
declare const astro: eslint_define_config.FlatESLintConfig[];
|
|
85
89
|
|
|
86
|
-
declare const jsonc:
|
|
90
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
87
91
|
|
|
88
|
-
declare const imports:
|
|
92
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
89
93
|
|
|
90
|
-
declare const unocss:
|
|
94
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
91
95
|
|
|
92
|
-
declare const unicorn:
|
|
96
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
93
97
|
|
|
94
|
-
declare const prettier:
|
|
98
|
+
declare const prettier: FlatESLintConfig[];
|
|
95
99
|
|
|
96
|
-
declare const markdown:
|
|
100
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
97
101
|
|
|
98
|
-
declare const comments:
|
|
102
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
99
103
|
|
|
100
|
-
declare const javascript:
|
|
101
|
-
declare const jsx:
|
|
104
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
105
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
102
106
|
|
|
103
|
-
declare const typescript:
|
|
107
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
104
108
|
|
|
105
109
|
/**
|
|
106
110
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
107
111
|
*/
|
|
108
|
-
declare const ignores:
|
|
112
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
109
113
|
|
|
110
114
|
export { GLOB_ALL_SRC, GLOB_ASTRO, 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, astro, basic, comments, common, getVueVersion, ignores, imports, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, react, sortPackageJson, sortTsConfig, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as eslint_define_config from 'eslint-define-config';
|
|
2
|
+
import { FlatESLintConfig } from 'eslint-define-config';
|
|
3
|
+
import * as eslintPluginYml from 'eslint-plugin-yml';
|
|
4
|
+
export { eslintPluginYml as pluginYaml };
|
|
5
|
+
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
6
|
+
export { eslintPluginAstro as pluginAstro };
|
|
2
7
|
export { default as pluginNode } from 'eslint-plugin-n';
|
|
3
8
|
export { default as pluginImport } from 'eslint-plugin-i';
|
|
4
|
-
export { default as pluginYml } from 'eslint-plugin-yml';
|
|
5
9
|
export { default as pluginVue } from 'eslint-plugin-vue';
|
|
6
|
-
export { default as pluginAstro } from 'eslint-plugin-astro';
|
|
7
10
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
8
11
|
export { default as pluginReact } from 'eslint-plugin-react';
|
|
9
12
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
@@ -12,12 +15,13 @@ export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
|
12
15
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
13
16
|
export { default as pluginReactHooks } from 'eslint-plugin-react-hooks';
|
|
14
17
|
export { default as pluginComments } from 'eslint-plugin-eslint-comments';
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
18
|
+
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
|
19
|
+
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
17
20
|
export { default as parserVue } from 'vue-eslint-parser';
|
|
18
21
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
19
22
|
export { default as parserAstro } from 'astro-eslint-parser';
|
|
20
|
-
|
|
23
|
+
import * as parser from '@typescript-eslint/parser';
|
|
24
|
+
export { parser as parserTs };
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* @file shared constants
|
|
@@ -53,58 +57,58 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
53
57
|
/**
|
|
54
58
|
* only js and ts
|
|
55
59
|
*/
|
|
56
|
-
declare const basic:
|
|
57
|
-
declare const common:
|
|
60
|
+
declare const basic: FlatESLintConfig[];
|
|
61
|
+
declare const common: FlatESLintConfig[];
|
|
58
62
|
/**
|
|
59
63
|
* all supported framework
|
|
60
64
|
*/
|
|
61
|
-
declare const all:
|
|
65
|
+
declare const all: FlatESLintConfig[];
|
|
62
66
|
/**
|
|
63
67
|
* custom framework support
|
|
64
68
|
*/
|
|
65
|
-
declare function ntnyq(config?:
|
|
69
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, react: enableReact, astro: enableAstro, unocss: enableUnoCSS, }?: {
|
|
66
70
|
vue?: boolean | undefined;
|
|
67
71
|
react?: boolean | undefined;
|
|
68
72
|
astro?: boolean | undefined;
|
|
69
73
|
unocss?: boolean | undefined;
|
|
70
|
-
}):
|
|
74
|
+
}): FlatESLintConfig[];
|
|
71
75
|
|
|
72
76
|
declare function getVueVersion(): number;
|
|
73
|
-
declare const vue:
|
|
77
|
+
declare const vue: FlatESLintConfig[];
|
|
74
78
|
|
|
75
|
-
declare const yml:
|
|
79
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
76
80
|
|
|
77
|
-
declare const node:
|
|
81
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
78
82
|
|
|
79
|
-
declare const sortPackageJson:
|
|
80
|
-
declare const sortTsConfig:
|
|
83
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
84
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
81
85
|
|
|
82
|
-
declare const react:
|
|
86
|
+
declare const react: eslint_define_config.FlatESLintConfig[];
|
|
83
87
|
|
|
84
|
-
declare const astro:
|
|
88
|
+
declare const astro: eslint_define_config.FlatESLintConfig[];
|
|
85
89
|
|
|
86
|
-
declare const jsonc:
|
|
90
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
87
91
|
|
|
88
|
-
declare const imports:
|
|
92
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
89
93
|
|
|
90
|
-
declare const unocss:
|
|
94
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
91
95
|
|
|
92
|
-
declare const unicorn:
|
|
96
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
93
97
|
|
|
94
|
-
declare const prettier:
|
|
98
|
+
declare const prettier: FlatESLintConfig[];
|
|
95
99
|
|
|
96
|
-
declare const markdown:
|
|
100
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
97
101
|
|
|
98
|
-
declare const comments:
|
|
102
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
99
103
|
|
|
100
|
-
declare const javascript:
|
|
101
|
-
declare const jsx:
|
|
104
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
105
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
102
106
|
|
|
103
|
-
declare const typescript:
|
|
107
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
104
108
|
|
|
105
109
|
/**
|
|
106
110
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
107
111
|
*/
|
|
108
|
-
declare const ignores:
|
|
112
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
109
113
|
|
|
110
114
|
export { GLOB_ALL_SRC, GLOB_ASTRO, 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, astro, basic, comments, common, getVueVersion, ignores, imports, javascript, jsonc, jsx, markdown, node, ntnyq, prettier, react, sortPackageJson, sortTsConfig, typescript, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -58,49 +58,52 @@ var GLOB_EXCLUDE = [
|
|
|
58
58
|
"**/.yarnrc"
|
|
59
59
|
];
|
|
60
60
|
|
|
61
|
+
// src/presets.ts
|
|
62
|
+
import { defineFlatConfig as defineFlatConfig17 } from "eslint-define-config";
|
|
63
|
+
|
|
61
64
|
// src/configs/vue.ts
|
|
62
65
|
import process from "node:process";
|
|
63
66
|
import { getPackageInfoSync } from "local-pkg";
|
|
64
|
-
|
|
65
|
-
// src/parsers.ts
|
|
66
|
-
import { default as default2 } from "yaml-eslint-parser";
|
|
67
|
-
import { default as default3 } from "vue-eslint-parser";
|
|
68
|
-
import { default as default4 } from "jsonc-eslint-parser";
|
|
69
|
-
import { default as default5 } from "astro-eslint-parser";
|
|
70
|
-
import { default as default6 } from "@typescript-eslint/parser";
|
|
67
|
+
import { defineFlatConfig as defineFlatConfig2 } from "eslint-define-config";
|
|
71
68
|
|
|
72
69
|
// src/plugins.ts
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
70
|
+
import * as pluginYaml from "eslint-plugin-yml";
|
|
71
|
+
import * as pluginAstro from "eslint-plugin-astro";
|
|
72
|
+
import { default as default2 } from "eslint-plugin-n";
|
|
73
|
+
import { default as default3 } from "eslint-plugin-i";
|
|
74
|
+
import { default as default4 } from "eslint-plugin-vue";
|
|
75
|
+
import { default as default5 } from "eslint-plugin-jsonc";
|
|
76
|
+
import { default as default6 } from "eslint-plugin-react";
|
|
77
|
+
import { default as default7 } from "@unocss/eslint-plugin";
|
|
78
|
+
import { default as default8 } from "eslint-plugin-unicorn";
|
|
79
|
+
import { default as default9 } from "eslint-plugin-prettier";
|
|
80
|
+
import { default as default10 } from "eslint-plugin-markdown";
|
|
81
|
+
import { default as default11 } from "eslint-plugin-react-hooks";
|
|
82
|
+
import { default as default12 } from "eslint-plugin-eslint-comments";
|
|
83
|
+
import { default as default13 } from "@typescript-eslint/eslint-plugin";
|
|
84
|
+
import { default as default14 } from "yaml-eslint-parser";
|
|
85
|
+
import { default as default15 } from "vue-eslint-parser";
|
|
86
|
+
import { default as default16 } from "jsonc-eslint-parser";
|
|
87
|
+
import { default as default17 } from "astro-eslint-parser";
|
|
88
|
+
import * as parserTs from "@typescript-eslint/parser";
|
|
87
89
|
|
|
88
90
|
// src/configs/typescript.ts
|
|
89
|
-
|
|
91
|
+
import { defineFlatConfig } from "eslint-define-config";
|
|
92
|
+
var typescript = defineFlatConfig([
|
|
90
93
|
{
|
|
91
94
|
files: [GLOB_TS, GLOB_TSX],
|
|
92
95
|
languageOptions: {
|
|
93
|
-
parser:
|
|
96
|
+
parser: parserTs,
|
|
94
97
|
parserOptions: {
|
|
95
98
|
sourceType: "module"
|
|
96
99
|
}
|
|
97
100
|
},
|
|
98
101
|
plugins: {
|
|
99
|
-
"@typescript-eslint":
|
|
102
|
+
"@typescript-eslint": default13
|
|
100
103
|
},
|
|
101
104
|
rules: {
|
|
102
|
-
...
|
|
103
|
-
...
|
|
105
|
+
...default13.configs.recommended.rules,
|
|
106
|
+
...default13.configs.stylistic.rules,
|
|
104
107
|
"@typescript-eslint/no-unused-vars": "error",
|
|
105
108
|
"@typescript-eslint/no-redeclare": "error",
|
|
106
109
|
"@typescript-eslint/consistent-type-imports": [
|
|
@@ -157,7 +160,7 @@ var typescript = [
|
|
|
157
160
|
"@typescript-eslint/no-var-requires": "off"
|
|
158
161
|
}
|
|
159
162
|
}
|
|
160
|
-
];
|
|
163
|
+
]);
|
|
161
164
|
|
|
162
165
|
// src/configs/vue.ts
|
|
163
166
|
function getVueVersion() {
|
|
@@ -175,15 +178,15 @@ var vue2Rules = {
|
|
|
175
178
|
var vue3Rules = {
|
|
176
179
|
...vueBaseRules
|
|
177
180
|
};
|
|
178
|
-
var vue = [
|
|
181
|
+
var vue = defineFlatConfig2([
|
|
179
182
|
{
|
|
180
183
|
files: [GLOB_VUE],
|
|
181
184
|
plugins: {
|
|
182
|
-
vue:
|
|
183
|
-
"@typescript-eslint":
|
|
185
|
+
vue: default4,
|
|
186
|
+
"@typescript-eslint": default13
|
|
184
187
|
},
|
|
185
188
|
languageOptions: {
|
|
186
|
-
parser:
|
|
189
|
+
parser: default15,
|
|
187
190
|
parserOptions: {
|
|
188
191
|
parser: "@typescript-eslint/parser",
|
|
189
192
|
sourceType: "module",
|
|
@@ -193,43 +196,45 @@ var vue = [
|
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
198
|
},
|
|
196
|
-
processor:
|
|
199
|
+
processor: default4.processors[".vue"],
|
|
197
200
|
rules: {
|
|
198
201
|
...typescript[0].rules
|
|
199
202
|
}
|
|
200
203
|
},
|
|
201
204
|
{
|
|
202
205
|
plugins: {
|
|
203
|
-
vue:
|
|
206
|
+
vue: default4
|
|
204
207
|
},
|
|
205
208
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
206
209
|
}
|
|
207
|
-
];
|
|
210
|
+
]);
|
|
208
211
|
|
|
209
212
|
// src/configs/yml.ts
|
|
210
|
-
|
|
213
|
+
import { defineFlatConfig as defineFlatConfig3 } from "eslint-define-config";
|
|
214
|
+
var yml = defineFlatConfig3([
|
|
211
215
|
{
|
|
212
216
|
files: [GLOB_YAML],
|
|
213
217
|
languageOptions: {
|
|
214
|
-
parser:
|
|
218
|
+
parser: default14
|
|
215
219
|
},
|
|
216
220
|
plugins: {
|
|
217
|
-
yml:
|
|
221
|
+
yml: pluginYaml
|
|
218
222
|
},
|
|
219
223
|
rules: {
|
|
220
|
-
...
|
|
221
|
-
...
|
|
224
|
+
...pluginYaml.configs.standard.rules,
|
|
225
|
+
...pluginYaml.configs.prettier.rules,
|
|
222
226
|
"yml/no-empty-mapping-value": "off",
|
|
223
227
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
|
-
];
|
|
230
|
+
]);
|
|
227
231
|
|
|
228
232
|
// src/configs/node.ts
|
|
229
|
-
|
|
233
|
+
import { defineFlatConfig as defineFlatConfig4 } from "eslint-define-config";
|
|
234
|
+
var node = defineFlatConfig4([
|
|
230
235
|
{
|
|
231
236
|
plugins: {
|
|
232
|
-
node:
|
|
237
|
+
node: default2
|
|
233
238
|
},
|
|
234
239
|
rules: {
|
|
235
240
|
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -242,10 +247,11 @@ var node = [
|
|
|
242
247
|
"node/process-exit-as-throw": "error"
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
];
|
|
250
|
+
]);
|
|
246
251
|
|
|
247
252
|
// src/configs/sort.ts
|
|
248
|
-
|
|
253
|
+
import { defineFlatConfig as defineFlatConfig5 } from "eslint-define-config";
|
|
254
|
+
var sortPackageJson = defineFlatConfig5([
|
|
249
255
|
{
|
|
250
256
|
files: ["**/package.json"],
|
|
251
257
|
rules: {
|
|
@@ -322,8 +328,8 @@ var sortPackageJson = [
|
|
|
322
328
|
]
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
|
-
];
|
|
326
|
-
var sortTsConfig = [
|
|
331
|
+
]);
|
|
332
|
+
var sortTsConfig = defineFlatConfig5([
|
|
327
333
|
{
|
|
328
334
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
329
335
|
rules: {
|
|
@@ -437,15 +443,16 @@ var sortTsConfig = [
|
|
|
437
443
|
]
|
|
438
444
|
}
|
|
439
445
|
}
|
|
440
|
-
];
|
|
446
|
+
]);
|
|
441
447
|
|
|
442
448
|
// src/configs/react.ts
|
|
443
|
-
|
|
449
|
+
import { defineFlatConfig as defineFlatConfig6 } from "eslint-define-config";
|
|
450
|
+
var react = defineFlatConfig6([
|
|
444
451
|
{
|
|
445
452
|
files: [GLOB_JSX, GLOB_TSX],
|
|
446
453
|
plugins: {
|
|
447
|
-
react:
|
|
448
|
-
"react-hooks":
|
|
454
|
+
react: default6,
|
|
455
|
+
"react-hooks": default11
|
|
449
456
|
},
|
|
450
457
|
settings: {
|
|
451
458
|
react: {
|
|
@@ -460,46 +467,48 @@ var react = [
|
|
|
460
467
|
}
|
|
461
468
|
},
|
|
462
469
|
rules: {
|
|
463
|
-
...
|
|
464
|
-
...
|
|
470
|
+
...default6.configs.recommended.rules,
|
|
471
|
+
...default11.configs.recommended.rules,
|
|
465
472
|
"jsx-quotes": ["error", "prefer-double"],
|
|
466
473
|
"react/react-in-jsx-scope": "off"
|
|
467
474
|
}
|
|
468
475
|
}
|
|
469
|
-
];
|
|
476
|
+
]);
|
|
470
477
|
|
|
471
478
|
// src/configs/astro.ts
|
|
472
|
-
|
|
479
|
+
import { defineFlatConfig as defineFlatConfig7 } from "eslint-define-config";
|
|
480
|
+
var astro = defineFlatConfig7([
|
|
473
481
|
{
|
|
474
482
|
files: [GLOB_ASTRO],
|
|
475
483
|
plugins: {
|
|
476
|
-
astro:
|
|
484
|
+
astro: pluginAstro
|
|
477
485
|
},
|
|
478
486
|
languageOptions: {
|
|
479
|
-
parser:
|
|
487
|
+
parser: default17,
|
|
480
488
|
parserOptions: {
|
|
481
489
|
parser: "@typescript-eslint/parser",
|
|
482
490
|
extraFileExtensions: [".astro"]
|
|
483
491
|
}
|
|
484
492
|
},
|
|
485
493
|
rules: {
|
|
486
|
-
...
|
|
494
|
+
...pluginAstro.configs.recommended.rules
|
|
487
495
|
}
|
|
488
496
|
}
|
|
489
|
-
];
|
|
497
|
+
]);
|
|
490
498
|
|
|
491
499
|
// src/configs/jsonc.ts
|
|
492
|
-
|
|
500
|
+
import { defineFlatConfig as defineFlatConfig8 } from "eslint-define-config";
|
|
501
|
+
var jsonc = defineFlatConfig8([
|
|
493
502
|
{
|
|
494
503
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
495
504
|
plugins: {
|
|
496
|
-
jsonc:
|
|
505
|
+
jsonc: default5
|
|
497
506
|
},
|
|
498
507
|
languageOptions: {
|
|
499
|
-
parser:
|
|
508
|
+
parser: default16
|
|
500
509
|
},
|
|
501
510
|
rules: {
|
|
502
|
-
...
|
|
511
|
+
...default5.configs["recommended-with-jsonc"].rules,
|
|
503
512
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
504
513
|
"jsonc/comma-dangle": ["error", "never"],
|
|
505
514
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -528,13 +537,14 @@ var jsonc = [
|
|
|
528
537
|
]
|
|
529
538
|
}
|
|
530
539
|
}
|
|
531
|
-
];
|
|
540
|
+
]);
|
|
532
541
|
|
|
533
542
|
// src/configs/imports.ts
|
|
534
|
-
|
|
543
|
+
import { defineFlatConfig as defineFlatConfig9 } from "eslint-define-config";
|
|
544
|
+
var imports = defineFlatConfig9([
|
|
535
545
|
{
|
|
536
546
|
plugins: {
|
|
537
|
-
import:
|
|
547
|
+
import: default3
|
|
538
548
|
},
|
|
539
549
|
settings: {
|
|
540
550
|
"import/resolver": {
|
|
@@ -570,25 +580,27 @@ var imports = [
|
|
|
570
580
|
]
|
|
571
581
|
}
|
|
572
582
|
}
|
|
573
|
-
];
|
|
583
|
+
]);
|
|
574
584
|
|
|
575
585
|
// src/configs/unocss.ts
|
|
576
|
-
|
|
586
|
+
import { defineFlatConfig as defineFlatConfig10 } from "eslint-define-config";
|
|
587
|
+
var unocss = defineFlatConfig10([
|
|
577
588
|
{
|
|
578
589
|
plugins: {
|
|
579
|
-
"@unocss":
|
|
590
|
+
"@unocss": default7
|
|
580
591
|
},
|
|
581
592
|
rules: {
|
|
582
|
-
...
|
|
593
|
+
...default7.configs.recommended.rules
|
|
583
594
|
}
|
|
584
595
|
}
|
|
585
|
-
];
|
|
596
|
+
]);
|
|
586
597
|
|
|
587
598
|
// src/configs/unicorn.ts
|
|
588
|
-
|
|
599
|
+
import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
|
|
600
|
+
var unicorn = defineFlatConfig11([
|
|
589
601
|
{
|
|
590
602
|
plugins: {
|
|
591
|
-
unicorn:
|
|
603
|
+
unicorn: default8
|
|
592
604
|
},
|
|
593
605
|
rules: {
|
|
594
606
|
"unicorn/no-unsafe-regex": "off",
|
|
@@ -657,29 +669,31 @@ var unicorn = [
|
|
|
657
669
|
"unicorn/prefer-array-index-of": "error"
|
|
658
670
|
}
|
|
659
671
|
}
|
|
660
|
-
];
|
|
672
|
+
]);
|
|
661
673
|
|
|
662
674
|
// src/configs/prettier.ts
|
|
663
675
|
import prettierConfig from "eslint-config-prettier";
|
|
664
|
-
|
|
676
|
+
import { defineFlatConfig as defineFlatConfig12 } from "eslint-define-config";
|
|
677
|
+
var prettier = defineFlatConfig12([
|
|
665
678
|
{
|
|
666
679
|
plugins: {
|
|
667
|
-
prettier:
|
|
680
|
+
prettier: default9
|
|
668
681
|
},
|
|
669
682
|
rules: {
|
|
670
683
|
...prettierConfig.rules,
|
|
671
|
-
...
|
|
684
|
+
...default9.configs.recommended.rules,
|
|
672
685
|
"prettier/prettier": "warn"
|
|
673
686
|
}
|
|
674
687
|
}
|
|
675
|
-
];
|
|
688
|
+
]);
|
|
676
689
|
|
|
677
690
|
// src/configs/markdown.ts
|
|
678
|
-
|
|
691
|
+
import { defineFlatConfig as defineFlatConfig13 } from "eslint-define-config";
|
|
692
|
+
var markdown = defineFlatConfig13([
|
|
679
693
|
{
|
|
680
694
|
files: [GLOB_MARKDOWN],
|
|
681
695
|
plugins: {
|
|
682
|
-
markdown:
|
|
696
|
+
markdown: default10
|
|
683
697
|
},
|
|
684
698
|
processor: "markdown/markdown"
|
|
685
699
|
},
|
|
@@ -693,10 +707,10 @@ var markdown = [
|
|
|
693
707
|
}
|
|
694
708
|
},
|
|
695
709
|
plugins: {
|
|
696
|
-
"@typescript-eslint":
|
|
710
|
+
"@typescript-eslint": default13
|
|
697
711
|
},
|
|
698
712
|
rules: {
|
|
699
|
-
...
|
|
713
|
+
...default10.configs.recommended.overrides[1].rules,
|
|
700
714
|
"no-undef": "off",
|
|
701
715
|
"no-alert": "off",
|
|
702
716
|
"no-console": "off",
|
|
@@ -714,25 +728,27 @@ var markdown = [
|
|
|
714
728
|
"unused-imports/no-unused-vars": "off"
|
|
715
729
|
}
|
|
716
730
|
}
|
|
717
|
-
];
|
|
731
|
+
]);
|
|
718
732
|
|
|
719
733
|
// src/configs/comments.ts
|
|
720
|
-
|
|
734
|
+
import { defineFlatConfig as defineFlatConfig14 } from "eslint-define-config";
|
|
735
|
+
var comments = defineFlatConfig14([
|
|
721
736
|
{
|
|
722
737
|
plugins: {
|
|
723
|
-
"eslint-comments":
|
|
738
|
+
"eslint-comments": default12
|
|
724
739
|
},
|
|
725
740
|
rules: {
|
|
726
|
-
...
|
|
741
|
+
...default12.configs.recommended.rules,
|
|
727
742
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
728
743
|
}
|
|
729
744
|
}
|
|
730
|
-
];
|
|
745
|
+
]);
|
|
731
746
|
|
|
732
747
|
// src/configs/javascript.ts
|
|
733
748
|
import globals from "globals";
|
|
734
749
|
import jsConfig from "@eslint/js";
|
|
735
|
-
|
|
750
|
+
import { defineFlatConfig as defineFlatConfig15 } from "eslint-define-config";
|
|
751
|
+
var javascript = defineFlatConfig15([
|
|
736
752
|
jsConfig.configs.recommended,
|
|
737
753
|
{
|
|
738
754
|
languageOptions: {
|
|
@@ -1093,8 +1109,8 @@ var javascript = [
|
|
|
1093
1109
|
"max-lines-per-function": "off"
|
|
1094
1110
|
}
|
|
1095
1111
|
}
|
|
1096
|
-
];
|
|
1097
|
-
var jsx = [
|
|
1112
|
+
]);
|
|
1113
|
+
var jsx = defineFlatConfig15([
|
|
1098
1114
|
{
|
|
1099
1115
|
files: ["**/*.jsx"],
|
|
1100
1116
|
languageOptions: {
|
|
@@ -1105,17 +1121,18 @@ var jsx = [
|
|
|
1105
1121
|
}
|
|
1106
1122
|
}
|
|
1107
1123
|
}
|
|
1108
|
-
];
|
|
1124
|
+
]);
|
|
1109
1125
|
|
|
1110
1126
|
// src/configs/ignores.ts
|
|
1111
|
-
|
|
1127
|
+
import { defineFlatConfig as defineFlatConfig16 } from "eslint-define-config";
|
|
1128
|
+
var ignores = defineFlatConfig16([
|
|
1112
1129
|
{
|
|
1113
1130
|
ignores: GLOB_EXCLUDE
|
|
1114
1131
|
}
|
|
1115
|
-
];
|
|
1132
|
+
]);
|
|
1116
1133
|
|
|
1117
1134
|
// src/presets.ts
|
|
1118
|
-
var basic = [
|
|
1135
|
+
var basic = defineFlatConfig17([
|
|
1119
1136
|
...ignores,
|
|
1120
1137
|
...javascript,
|
|
1121
1138
|
...jsx,
|
|
@@ -1124,8 +1141,8 @@ var basic = [
|
|
|
1124
1141
|
...imports,
|
|
1125
1142
|
...unicorn,
|
|
1126
1143
|
...comments
|
|
1127
|
-
];
|
|
1128
|
-
var common = [
|
|
1144
|
+
]);
|
|
1145
|
+
var common = defineFlatConfig17([
|
|
1129
1146
|
...basic,
|
|
1130
1147
|
...yml,
|
|
1131
1148
|
...jsonc,
|
|
@@ -1133,15 +1150,15 @@ var common = [
|
|
|
1133
1150
|
...sortTsConfig,
|
|
1134
1151
|
...prettier,
|
|
1135
1152
|
...markdown
|
|
1136
|
-
];
|
|
1137
|
-
var all = [...common, ...vue, ...react, ...astro, ...unocss];
|
|
1153
|
+
]);
|
|
1154
|
+
var all = defineFlatConfig17([...common, ...vue, ...react, ...astro, ...unocss]);
|
|
1138
1155
|
function ntnyq(config = [], {
|
|
1139
1156
|
vue: enableVue = false,
|
|
1140
1157
|
react: enableReact = false,
|
|
1141
1158
|
astro: enableAstro = false,
|
|
1142
1159
|
unocss: enableUnoCSS = false
|
|
1143
1160
|
} = {}) {
|
|
1144
|
-
const configs = [...common];
|
|
1161
|
+
const configs = defineFlatConfig17([...common]);
|
|
1145
1162
|
if (enableVue) {
|
|
1146
1163
|
configs.push(...vue);
|
|
1147
1164
|
}
|
|
@@ -1197,25 +1214,25 @@ export {
|
|
|
1197
1214
|
markdown,
|
|
1198
1215
|
node,
|
|
1199
1216
|
ntnyq,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1217
|
+
default17 as parserAstro,
|
|
1218
|
+
default16 as parserJsonc,
|
|
1219
|
+
parserTs,
|
|
1220
|
+
default15 as parserVue,
|
|
1221
|
+
default14 as parserYaml,
|
|
1222
|
+
pluginAstro,
|
|
1223
|
+
default12 as pluginComments,
|
|
1224
|
+
default3 as pluginImport,
|
|
1225
|
+
default5 as pluginJsonc,
|
|
1226
|
+
default10 as pluginMarkdown,
|
|
1227
|
+
default2 as pluginNode,
|
|
1228
|
+
default9 as pluginPrettier,
|
|
1229
|
+
default6 as pluginReact,
|
|
1230
|
+
default11 as pluginReactHooks,
|
|
1231
|
+
default13 as pluginTs,
|
|
1232
|
+
default8 as pluginUnicorn,
|
|
1233
|
+
default7 as pluginUnoCSS,
|
|
1234
|
+
default4 as pluginVue,
|
|
1235
|
+
pluginYaml,
|
|
1219
1236
|
prettier,
|
|
1220
1237
|
react,
|
|
1221
1238
|
sortPackageJson,
|
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.22",
|
|
5
5
|
"description": "ESLint flat config of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -48,45 +48,45 @@
|
|
|
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
|
-
"astro-eslint-parser": "^0.
|
|
54
|
+
"@eslint/js": "^8.54.0",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
56
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
57
|
+
"@unocss/eslint-plugin": "^0.57.7",
|
|
58
|
+
"astro-eslint-parser": "^0.16.0",
|
|
59
59
|
"eslint-config-prettier": "^9.0.0",
|
|
60
|
-
"eslint-define-config": "^
|
|
61
|
-
"eslint-plugin-astro": "^0.29.
|
|
60
|
+
"eslint-define-config": "^2.0.0",
|
|
61
|
+
"eslint-plugin-astro": "^0.29.1",
|
|
62
62
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
63
|
-
"eslint-plugin-i": "^2.
|
|
64
|
-
"eslint-plugin-jsonc": "^2.
|
|
63
|
+
"eslint-plugin-i": "^2.29.0",
|
|
64
|
+
"eslint-plugin-jsonc": "^2.10.0",
|
|
65
65
|
"eslint-plugin-markdown": "^3.0.1",
|
|
66
|
-
"eslint-plugin-n": "^16.1
|
|
67
|
-
"eslint-plugin-prettier": "^5.0.
|
|
66
|
+
"eslint-plugin-n": "^16.3.1",
|
|
67
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
68
68
|
"eslint-plugin-react": "^7.33.2",
|
|
69
69
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
70
|
-
"eslint-plugin-unicorn": "^
|
|
71
|
-
"eslint-plugin-vue": "^9.
|
|
72
|
-
"eslint-plugin-yml": "^1.
|
|
73
|
-
"globals": "^13.
|
|
74
|
-
"jsonc-eslint-parser": "^2.
|
|
75
|
-
"local-pkg": "^0.
|
|
76
|
-
"prettier": "^3.0
|
|
77
|
-
"vue-eslint-parser": "^9.3.
|
|
70
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
71
|
+
"eslint-plugin-vue": "^9.18.1",
|
|
72
|
+
"eslint-plugin-yml": "^1.10.0",
|
|
73
|
+
"globals": "^13.23.0",
|
|
74
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
75
|
+
"local-pkg": "^0.5.0",
|
|
76
|
+
"prettier": "^3.1.0",
|
|
77
|
+
"vue-eslint-parser": "^9.3.2",
|
|
78
78
|
"yaml-eslint-parser": "^1.2.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@ntnyq/prettier-config": "^1.
|
|
82
|
-
"@types/node": "^20.
|
|
81
|
+
"@ntnyq/prettier-config": "^1.19.0",
|
|
82
|
+
"@types/node": "^20.9.5",
|
|
83
83
|
"bumpp": "^9.2.0",
|
|
84
|
-
"eslint": "^8.
|
|
84
|
+
"eslint": "^8.54.0",
|
|
85
85
|
"husky": "^8.0.3",
|
|
86
86
|
"nano-staged": "^0.8.0",
|
|
87
87
|
"npm-run-all": "^4.1.5",
|
|
88
|
-
"rimraf": "^5.0.
|
|
89
|
-
"tsup": "^
|
|
88
|
+
"rimraf": "^5.0.5",
|
|
89
|
+
"tsup": "^8.0.1",
|
|
90
90
|
"typescript": "5.2.2"
|
|
91
91
|
},
|
|
92
92
|
"engines": {
|