@ntnyq/eslint-config 2.0.0-beta.21 → 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 +61 -42
- package/dist/index.d.cts +25 -24
- package/dist/index.d.ts +25 -24
- package/dist/index.js +61 -42
- package/package.json +17 -17
package/dist/index.cjs
CHANGED
|
@@ -158,9 +158,13 @@ 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");
|
|
167
|
+
var import_eslint_define_config2 = require("eslint-define-config");
|
|
164
168
|
|
|
165
169
|
// src/plugins.ts
|
|
166
170
|
var pluginYaml = __toESM(require("eslint-plugin-yml"), 1);
|
|
@@ -184,7 +188,8 @@ var import_astro_eslint_parser = __toESM(require("astro-eslint-parser"), 1);
|
|
|
184
188
|
var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
|
|
185
189
|
|
|
186
190
|
// src/configs/typescript.ts
|
|
187
|
-
var
|
|
191
|
+
var import_eslint_define_config = require("eslint-define-config");
|
|
192
|
+
var typescript = (0, import_eslint_define_config.defineFlatConfig)([
|
|
188
193
|
{
|
|
189
194
|
files: [GLOB_TS, GLOB_TSX],
|
|
190
195
|
languageOptions: {
|
|
@@ -255,7 +260,7 @@ var typescript = [
|
|
|
255
260
|
"@typescript-eslint/no-var-requires": "off"
|
|
256
261
|
}
|
|
257
262
|
}
|
|
258
|
-
];
|
|
263
|
+
]);
|
|
259
264
|
|
|
260
265
|
// src/configs/vue.ts
|
|
261
266
|
function getVueVersion() {
|
|
@@ -273,7 +278,7 @@ var vue2Rules = {
|
|
|
273
278
|
var vue3Rules = {
|
|
274
279
|
...vueBaseRules
|
|
275
280
|
};
|
|
276
|
-
var vue = [
|
|
281
|
+
var vue = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
277
282
|
{
|
|
278
283
|
files: [GLOB_VUE],
|
|
279
284
|
plugins: {
|
|
@@ -302,10 +307,11 @@ var vue = [
|
|
|
302
307
|
},
|
|
303
308
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
304
309
|
}
|
|
305
|
-
];
|
|
310
|
+
]);
|
|
306
311
|
|
|
307
312
|
// src/configs/yml.ts
|
|
308
|
-
var
|
|
313
|
+
var import_eslint_define_config3 = require("eslint-define-config");
|
|
314
|
+
var yml = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
309
315
|
{
|
|
310
316
|
files: [GLOB_YAML],
|
|
311
317
|
languageOptions: {
|
|
@@ -321,10 +327,11 @@ var yml = [
|
|
|
321
327
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
322
328
|
}
|
|
323
329
|
}
|
|
324
|
-
];
|
|
330
|
+
]);
|
|
325
331
|
|
|
326
332
|
// src/configs/node.ts
|
|
327
|
-
var
|
|
333
|
+
var import_eslint_define_config4 = require("eslint-define-config");
|
|
334
|
+
var node = (0, import_eslint_define_config4.defineFlatConfig)([
|
|
328
335
|
{
|
|
329
336
|
plugins: {
|
|
330
337
|
node: import_eslint_plugin_n.default
|
|
@@ -340,10 +347,11 @@ var node = [
|
|
|
340
347
|
"node/process-exit-as-throw": "error"
|
|
341
348
|
}
|
|
342
349
|
}
|
|
343
|
-
];
|
|
350
|
+
]);
|
|
344
351
|
|
|
345
352
|
// src/configs/sort.ts
|
|
346
|
-
var
|
|
353
|
+
var import_eslint_define_config5 = require("eslint-define-config");
|
|
354
|
+
var sortPackageJson = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
347
355
|
{
|
|
348
356
|
files: ["**/package.json"],
|
|
349
357
|
rules: {
|
|
@@ -420,8 +428,8 @@ var sortPackageJson = [
|
|
|
420
428
|
]
|
|
421
429
|
}
|
|
422
430
|
}
|
|
423
|
-
];
|
|
424
|
-
var sortTsConfig = [
|
|
431
|
+
]);
|
|
432
|
+
var sortTsConfig = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
425
433
|
{
|
|
426
434
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
427
435
|
rules: {
|
|
@@ -535,10 +543,11 @@ var sortTsConfig = [
|
|
|
535
543
|
]
|
|
536
544
|
}
|
|
537
545
|
}
|
|
538
|
-
];
|
|
546
|
+
]);
|
|
539
547
|
|
|
540
548
|
// src/configs/react.ts
|
|
541
|
-
var
|
|
549
|
+
var import_eslint_define_config6 = require("eslint-define-config");
|
|
550
|
+
var react = (0, import_eslint_define_config6.defineFlatConfig)([
|
|
542
551
|
{
|
|
543
552
|
files: [GLOB_JSX, GLOB_TSX],
|
|
544
553
|
plugins: {
|
|
@@ -564,10 +573,11 @@ var react = [
|
|
|
564
573
|
"react/react-in-jsx-scope": "off"
|
|
565
574
|
}
|
|
566
575
|
}
|
|
567
|
-
];
|
|
576
|
+
]);
|
|
568
577
|
|
|
569
578
|
// src/configs/astro.ts
|
|
570
|
-
var
|
|
579
|
+
var import_eslint_define_config7 = require("eslint-define-config");
|
|
580
|
+
var astro = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
571
581
|
{
|
|
572
582
|
files: [GLOB_ASTRO],
|
|
573
583
|
plugins: {
|
|
@@ -584,10 +594,11 @@ var astro = [
|
|
|
584
594
|
...pluginAstro.configs.recommended.rules
|
|
585
595
|
}
|
|
586
596
|
}
|
|
587
|
-
];
|
|
597
|
+
]);
|
|
588
598
|
|
|
589
599
|
// src/configs/jsonc.ts
|
|
590
|
-
var
|
|
600
|
+
var import_eslint_define_config8 = require("eslint-define-config");
|
|
601
|
+
var jsonc = (0, import_eslint_define_config8.defineFlatConfig)([
|
|
591
602
|
{
|
|
592
603
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
593
604
|
plugins: {
|
|
@@ -626,10 +637,11 @@ var jsonc = [
|
|
|
626
637
|
]
|
|
627
638
|
}
|
|
628
639
|
}
|
|
629
|
-
];
|
|
640
|
+
]);
|
|
630
641
|
|
|
631
642
|
// src/configs/imports.ts
|
|
632
|
-
var
|
|
643
|
+
var import_eslint_define_config9 = require("eslint-define-config");
|
|
644
|
+
var imports = (0, import_eslint_define_config9.defineFlatConfig)([
|
|
633
645
|
{
|
|
634
646
|
plugins: {
|
|
635
647
|
import: import_eslint_plugin_i.default
|
|
@@ -668,10 +680,11 @@ var imports = [
|
|
|
668
680
|
]
|
|
669
681
|
}
|
|
670
682
|
}
|
|
671
|
-
];
|
|
683
|
+
]);
|
|
672
684
|
|
|
673
685
|
// src/configs/unocss.ts
|
|
674
|
-
var
|
|
686
|
+
var import_eslint_define_config10 = require("eslint-define-config");
|
|
687
|
+
var unocss = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
675
688
|
{
|
|
676
689
|
plugins: {
|
|
677
690
|
"@unocss": import_eslint_plugin.default
|
|
@@ -680,10 +693,11 @@ var unocss = [
|
|
|
680
693
|
...import_eslint_plugin.default.configs.recommended.rules
|
|
681
694
|
}
|
|
682
695
|
}
|
|
683
|
-
];
|
|
696
|
+
]);
|
|
684
697
|
|
|
685
698
|
// src/configs/unicorn.ts
|
|
686
|
-
var
|
|
699
|
+
var import_eslint_define_config11 = require("eslint-define-config");
|
|
700
|
+
var unicorn = (0, import_eslint_define_config11.defineFlatConfig)([
|
|
687
701
|
{
|
|
688
702
|
plugins: {
|
|
689
703
|
unicorn: import_eslint_plugin_unicorn.default
|
|
@@ -755,11 +769,12 @@ var unicorn = [
|
|
|
755
769
|
"unicorn/prefer-array-index-of": "error"
|
|
756
770
|
}
|
|
757
771
|
}
|
|
758
|
-
];
|
|
772
|
+
]);
|
|
759
773
|
|
|
760
774
|
// src/configs/prettier.ts
|
|
761
775
|
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
762
|
-
var
|
|
776
|
+
var import_eslint_define_config12 = require("eslint-define-config");
|
|
777
|
+
var prettier = (0, import_eslint_define_config12.defineFlatConfig)([
|
|
763
778
|
{
|
|
764
779
|
plugins: {
|
|
765
780
|
prettier: import_eslint_plugin_prettier.default
|
|
@@ -770,10 +785,11 @@ var prettier = [
|
|
|
770
785
|
"prettier/prettier": "warn"
|
|
771
786
|
}
|
|
772
787
|
}
|
|
773
|
-
];
|
|
788
|
+
]);
|
|
774
789
|
|
|
775
790
|
// src/configs/markdown.ts
|
|
776
|
-
var
|
|
791
|
+
var import_eslint_define_config13 = require("eslint-define-config");
|
|
792
|
+
var markdown = (0, import_eslint_define_config13.defineFlatConfig)([
|
|
777
793
|
{
|
|
778
794
|
files: [GLOB_MARKDOWN],
|
|
779
795
|
plugins: {
|
|
@@ -812,10 +828,11 @@ var markdown = [
|
|
|
812
828
|
"unused-imports/no-unused-vars": "off"
|
|
813
829
|
}
|
|
814
830
|
}
|
|
815
|
-
];
|
|
831
|
+
]);
|
|
816
832
|
|
|
817
833
|
// src/configs/comments.ts
|
|
818
|
-
var
|
|
834
|
+
var import_eslint_define_config14 = require("eslint-define-config");
|
|
835
|
+
var comments = (0, import_eslint_define_config14.defineFlatConfig)([
|
|
819
836
|
{
|
|
820
837
|
plugins: {
|
|
821
838
|
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
@@ -825,12 +842,13 @@ var comments = [
|
|
|
825
842
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
826
843
|
}
|
|
827
844
|
}
|
|
828
|
-
];
|
|
845
|
+
]);
|
|
829
846
|
|
|
830
847
|
// src/configs/javascript.ts
|
|
831
848
|
var import_globals = __toESM(require("globals"), 1);
|
|
832
849
|
var import_js = __toESM(require("@eslint/js"), 1);
|
|
833
|
-
var
|
|
850
|
+
var import_eslint_define_config15 = require("eslint-define-config");
|
|
851
|
+
var javascript = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
834
852
|
import_js.default.configs.recommended,
|
|
835
853
|
{
|
|
836
854
|
languageOptions: {
|
|
@@ -1191,8 +1209,8 @@ var javascript = [
|
|
|
1191
1209
|
"max-lines-per-function": "off"
|
|
1192
1210
|
}
|
|
1193
1211
|
}
|
|
1194
|
-
];
|
|
1195
|
-
var jsx = [
|
|
1212
|
+
]);
|
|
1213
|
+
var jsx = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
1196
1214
|
{
|
|
1197
1215
|
files: ["**/*.jsx"],
|
|
1198
1216
|
languageOptions: {
|
|
@@ -1203,17 +1221,18 @@ var jsx = [
|
|
|
1203
1221
|
}
|
|
1204
1222
|
}
|
|
1205
1223
|
}
|
|
1206
|
-
];
|
|
1224
|
+
]);
|
|
1207
1225
|
|
|
1208
1226
|
// src/configs/ignores.ts
|
|
1209
|
-
var
|
|
1227
|
+
var import_eslint_define_config16 = require("eslint-define-config");
|
|
1228
|
+
var ignores = (0, import_eslint_define_config16.defineFlatConfig)([
|
|
1210
1229
|
{
|
|
1211
1230
|
ignores: GLOB_EXCLUDE
|
|
1212
1231
|
}
|
|
1213
|
-
];
|
|
1232
|
+
]);
|
|
1214
1233
|
|
|
1215
1234
|
// src/presets.ts
|
|
1216
|
-
var basic = [
|
|
1235
|
+
var basic = (0, import_eslint_define_config17.defineFlatConfig)([
|
|
1217
1236
|
...ignores,
|
|
1218
1237
|
...javascript,
|
|
1219
1238
|
...jsx,
|
|
@@ -1222,8 +1241,8 @@ var basic = [
|
|
|
1222
1241
|
...imports,
|
|
1223
1242
|
...unicorn,
|
|
1224
1243
|
...comments
|
|
1225
|
-
];
|
|
1226
|
-
var common = [
|
|
1244
|
+
]);
|
|
1245
|
+
var common = (0, import_eslint_define_config17.defineFlatConfig)([
|
|
1227
1246
|
...basic,
|
|
1228
1247
|
...yml,
|
|
1229
1248
|
...jsonc,
|
|
@@ -1231,15 +1250,15 @@ var common = [
|
|
|
1231
1250
|
...sortTsConfig,
|
|
1232
1251
|
...prettier,
|
|
1233
1252
|
...markdown
|
|
1234
|
-
];
|
|
1235
|
-
var all = [...common, ...vue, ...react, ...astro, ...unocss];
|
|
1253
|
+
]);
|
|
1254
|
+
var all = (0, import_eslint_define_config17.defineFlatConfig)([...common, ...vue, ...react, ...astro, ...unocss]);
|
|
1236
1255
|
function ntnyq(config = [], {
|
|
1237
1256
|
vue: enableVue = false,
|
|
1238
1257
|
react: enableReact = false,
|
|
1239
1258
|
astro: enableAstro = false,
|
|
1240
1259
|
unocss: enableUnoCSS = false
|
|
1241
1260
|
} = {}) {
|
|
1242
|
-
const configs = [...common];
|
|
1261
|
+
const configs = (0, import_eslint_define_config17.defineFlatConfig)([...common]);
|
|
1243
1262
|
if (enableVue) {
|
|
1244
1263
|
configs.push(...vue);
|
|
1245
1264
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
5
|
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
@@ -56,58 +57,58 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
56
57
|
/**
|
|
57
58
|
* only js and ts
|
|
58
59
|
*/
|
|
59
|
-
declare const basic:
|
|
60
|
-
declare const common:
|
|
60
|
+
declare const basic: FlatESLintConfig[];
|
|
61
|
+
declare const common: FlatESLintConfig[];
|
|
61
62
|
/**
|
|
62
63
|
* all supported framework
|
|
63
64
|
*/
|
|
64
|
-
declare const all:
|
|
65
|
+
declare const all: FlatESLintConfig[];
|
|
65
66
|
/**
|
|
66
67
|
* custom framework support
|
|
67
68
|
*/
|
|
68
|
-
declare function ntnyq(config?:
|
|
69
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, react: enableReact, astro: enableAstro, unocss: enableUnoCSS, }?: {
|
|
69
70
|
vue?: boolean | undefined;
|
|
70
71
|
react?: boolean | undefined;
|
|
71
72
|
astro?: boolean | undefined;
|
|
72
73
|
unocss?: boolean | undefined;
|
|
73
|
-
}):
|
|
74
|
+
}): FlatESLintConfig[];
|
|
74
75
|
|
|
75
76
|
declare function getVueVersion(): number;
|
|
76
|
-
declare const vue:
|
|
77
|
+
declare const vue: FlatESLintConfig[];
|
|
77
78
|
|
|
78
|
-
declare const yml:
|
|
79
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
79
80
|
|
|
80
|
-
declare const node:
|
|
81
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
81
82
|
|
|
82
|
-
declare const sortPackageJson:
|
|
83
|
-
declare const sortTsConfig:
|
|
83
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
84
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
84
85
|
|
|
85
|
-
declare const react:
|
|
86
|
+
declare const react: eslint_define_config.FlatESLintConfig[];
|
|
86
87
|
|
|
87
|
-
declare const astro:
|
|
88
|
+
declare const astro: eslint_define_config.FlatESLintConfig[];
|
|
88
89
|
|
|
89
|
-
declare const jsonc:
|
|
90
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
90
91
|
|
|
91
|
-
declare const imports:
|
|
92
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
92
93
|
|
|
93
|
-
declare const unocss:
|
|
94
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
94
95
|
|
|
95
|
-
declare const unicorn:
|
|
96
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
96
97
|
|
|
97
|
-
declare const prettier:
|
|
98
|
+
declare const prettier: FlatESLintConfig[];
|
|
98
99
|
|
|
99
|
-
declare const markdown:
|
|
100
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
100
101
|
|
|
101
|
-
declare const comments:
|
|
102
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
102
103
|
|
|
103
|
-
declare const javascript:
|
|
104
|
-
declare const jsx:
|
|
104
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
105
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
105
106
|
|
|
106
|
-
declare const typescript:
|
|
107
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
110
111
|
*/
|
|
111
|
-
declare const ignores:
|
|
112
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
112
113
|
|
|
113
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,4 +1,5 @@
|
|
|
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
5
|
import * as eslintPluginAstro from 'eslint-plugin-astro';
|
|
@@ -56,58 +57,58 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
56
57
|
/**
|
|
57
58
|
* only js and ts
|
|
58
59
|
*/
|
|
59
|
-
declare const basic:
|
|
60
|
-
declare const common:
|
|
60
|
+
declare const basic: FlatESLintConfig[];
|
|
61
|
+
declare const common: FlatESLintConfig[];
|
|
61
62
|
/**
|
|
62
63
|
* all supported framework
|
|
63
64
|
*/
|
|
64
|
-
declare const all:
|
|
65
|
+
declare const all: FlatESLintConfig[];
|
|
65
66
|
/**
|
|
66
67
|
* custom framework support
|
|
67
68
|
*/
|
|
68
|
-
declare function ntnyq(config?:
|
|
69
|
+
declare function ntnyq(config?: FlatESLintConfig | FlatESLintConfig[], { vue: enableVue, react: enableReact, astro: enableAstro, unocss: enableUnoCSS, }?: {
|
|
69
70
|
vue?: boolean | undefined;
|
|
70
71
|
react?: boolean | undefined;
|
|
71
72
|
astro?: boolean | undefined;
|
|
72
73
|
unocss?: boolean | undefined;
|
|
73
|
-
}):
|
|
74
|
+
}): FlatESLintConfig[];
|
|
74
75
|
|
|
75
76
|
declare function getVueVersion(): number;
|
|
76
|
-
declare const vue:
|
|
77
|
+
declare const vue: FlatESLintConfig[];
|
|
77
78
|
|
|
78
|
-
declare const yml:
|
|
79
|
+
declare const yml: eslint_define_config.FlatESLintConfig[];
|
|
79
80
|
|
|
80
|
-
declare const node:
|
|
81
|
+
declare const node: eslint_define_config.FlatESLintConfig[];
|
|
81
82
|
|
|
82
|
-
declare const sortPackageJson:
|
|
83
|
-
declare const sortTsConfig:
|
|
83
|
+
declare const sortPackageJson: eslint_define_config.FlatESLintConfig[];
|
|
84
|
+
declare const sortTsConfig: eslint_define_config.FlatESLintConfig[];
|
|
84
85
|
|
|
85
|
-
declare const react:
|
|
86
|
+
declare const react: eslint_define_config.FlatESLintConfig[];
|
|
86
87
|
|
|
87
|
-
declare const astro:
|
|
88
|
+
declare const astro: eslint_define_config.FlatESLintConfig[];
|
|
88
89
|
|
|
89
|
-
declare const jsonc:
|
|
90
|
+
declare const jsonc: eslint_define_config.FlatESLintConfig[];
|
|
90
91
|
|
|
91
|
-
declare const imports:
|
|
92
|
+
declare const imports: eslint_define_config.FlatESLintConfig[];
|
|
92
93
|
|
|
93
|
-
declare const unocss:
|
|
94
|
+
declare const unocss: eslint_define_config.FlatESLintConfig[];
|
|
94
95
|
|
|
95
|
-
declare const unicorn:
|
|
96
|
+
declare const unicorn: eslint_define_config.FlatESLintConfig[];
|
|
96
97
|
|
|
97
|
-
declare const prettier:
|
|
98
|
+
declare const prettier: FlatESLintConfig[];
|
|
98
99
|
|
|
99
|
-
declare const markdown:
|
|
100
|
+
declare const markdown: eslint_define_config.FlatESLintConfig[];
|
|
100
101
|
|
|
101
|
-
declare const comments:
|
|
102
|
+
declare const comments: eslint_define_config.FlatESLintConfig[];
|
|
102
103
|
|
|
103
|
-
declare const javascript:
|
|
104
|
-
declare const jsx:
|
|
104
|
+
declare const javascript: eslint_define_config.FlatESLintConfig[];
|
|
105
|
+
declare const jsx: eslint_define_config.FlatESLintConfig[];
|
|
105
106
|
|
|
106
|
-
declare const typescript:
|
|
107
|
+
declare const typescript: eslint_define_config.FlatESLintConfig[];
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
110
111
|
*/
|
|
111
|
-
declare const ignores:
|
|
112
|
+
declare const ignores: eslint_define_config.FlatESLintConfig[];
|
|
112
113
|
|
|
113
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,9 +58,13 @@ 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";
|
|
67
|
+
import { defineFlatConfig as defineFlatConfig2 } from "eslint-define-config";
|
|
64
68
|
|
|
65
69
|
// src/plugins.ts
|
|
66
70
|
import * as pluginYaml from "eslint-plugin-yml";
|
|
@@ -84,7 +88,8 @@ import { default as default17 } from "astro-eslint-parser";
|
|
|
84
88
|
import * as parserTs from "@typescript-eslint/parser";
|
|
85
89
|
|
|
86
90
|
// src/configs/typescript.ts
|
|
87
|
-
|
|
91
|
+
import { defineFlatConfig } from "eslint-define-config";
|
|
92
|
+
var typescript = defineFlatConfig([
|
|
88
93
|
{
|
|
89
94
|
files: [GLOB_TS, GLOB_TSX],
|
|
90
95
|
languageOptions: {
|
|
@@ -155,7 +160,7 @@ var typescript = [
|
|
|
155
160
|
"@typescript-eslint/no-var-requires": "off"
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
|
-
];
|
|
163
|
+
]);
|
|
159
164
|
|
|
160
165
|
// src/configs/vue.ts
|
|
161
166
|
function getVueVersion() {
|
|
@@ -173,7 +178,7 @@ var vue2Rules = {
|
|
|
173
178
|
var vue3Rules = {
|
|
174
179
|
...vueBaseRules
|
|
175
180
|
};
|
|
176
|
-
var vue = [
|
|
181
|
+
var vue = defineFlatConfig2([
|
|
177
182
|
{
|
|
178
183
|
files: [GLOB_VUE],
|
|
179
184
|
plugins: {
|
|
@@ -202,10 +207,11 @@ var vue = [
|
|
|
202
207
|
},
|
|
203
208
|
rules: isVue3 ? vue3Rules : vue2Rules
|
|
204
209
|
}
|
|
205
|
-
];
|
|
210
|
+
]);
|
|
206
211
|
|
|
207
212
|
// src/configs/yml.ts
|
|
208
|
-
|
|
213
|
+
import { defineFlatConfig as defineFlatConfig3 } from "eslint-define-config";
|
|
214
|
+
var yml = defineFlatConfig3([
|
|
209
215
|
{
|
|
210
216
|
files: [GLOB_YAML],
|
|
211
217
|
languageOptions: {
|
|
@@ -221,10 +227,11 @@ var yml = [
|
|
|
221
227
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
|
-
];
|
|
230
|
+
]);
|
|
225
231
|
|
|
226
232
|
// src/configs/node.ts
|
|
227
|
-
|
|
233
|
+
import { defineFlatConfig as defineFlatConfig4 } from "eslint-define-config";
|
|
234
|
+
var node = defineFlatConfig4([
|
|
228
235
|
{
|
|
229
236
|
plugins: {
|
|
230
237
|
node: default2
|
|
@@ -240,10 +247,11 @@ var node = [
|
|
|
240
247
|
"node/process-exit-as-throw": "error"
|
|
241
248
|
}
|
|
242
249
|
}
|
|
243
|
-
];
|
|
250
|
+
]);
|
|
244
251
|
|
|
245
252
|
// src/configs/sort.ts
|
|
246
|
-
|
|
253
|
+
import { defineFlatConfig as defineFlatConfig5 } from "eslint-define-config";
|
|
254
|
+
var sortPackageJson = defineFlatConfig5([
|
|
247
255
|
{
|
|
248
256
|
files: ["**/package.json"],
|
|
249
257
|
rules: {
|
|
@@ -320,8 +328,8 @@ var sortPackageJson = [
|
|
|
320
328
|
]
|
|
321
329
|
}
|
|
322
330
|
}
|
|
323
|
-
];
|
|
324
|
-
var sortTsConfig = [
|
|
331
|
+
]);
|
|
332
|
+
var sortTsConfig = defineFlatConfig5([
|
|
325
333
|
{
|
|
326
334
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
327
335
|
rules: {
|
|
@@ -435,10 +443,11 @@ var sortTsConfig = [
|
|
|
435
443
|
]
|
|
436
444
|
}
|
|
437
445
|
}
|
|
438
|
-
];
|
|
446
|
+
]);
|
|
439
447
|
|
|
440
448
|
// src/configs/react.ts
|
|
441
|
-
|
|
449
|
+
import { defineFlatConfig as defineFlatConfig6 } from "eslint-define-config";
|
|
450
|
+
var react = defineFlatConfig6([
|
|
442
451
|
{
|
|
443
452
|
files: [GLOB_JSX, GLOB_TSX],
|
|
444
453
|
plugins: {
|
|
@@ -464,10 +473,11 @@ var react = [
|
|
|
464
473
|
"react/react-in-jsx-scope": "off"
|
|
465
474
|
}
|
|
466
475
|
}
|
|
467
|
-
];
|
|
476
|
+
]);
|
|
468
477
|
|
|
469
478
|
// src/configs/astro.ts
|
|
470
|
-
|
|
479
|
+
import { defineFlatConfig as defineFlatConfig7 } from "eslint-define-config";
|
|
480
|
+
var astro = defineFlatConfig7([
|
|
471
481
|
{
|
|
472
482
|
files: [GLOB_ASTRO],
|
|
473
483
|
plugins: {
|
|
@@ -484,10 +494,11 @@ var astro = [
|
|
|
484
494
|
...pluginAstro.configs.recommended.rules
|
|
485
495
|
}
|
|
486
496
|
}
|
|
487
|
-
];
|
|
497
|
+
]);
|
|
488
498
|
|
|
489
499
|
// src/configs/jsonc.ts
|
|
490
|
-
|
|
500
|
+
import { defineFlatConfig as defineFlatConfig8 } from "eslint-define-config";
|
|
501
|
+
var jsonc = defineFlatConfig8([
|
|
491
502
|
{
|
|
492
503
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
493
504
|
plugins: {
|
|
@@ -526,10 +537,11 @@ var jsonc = [
|
|
|
526
537
|
]
|
|
527
538
|
}
|
|
528
539
|
}
|
|
529
|
-
];
|
|
540
|
+
]);
|
|
530
541
|
|
|
531
542
|
// src/configs/imports.ts
|
|
532
|
-
|
|
543
|
+
import { defineFlatConfig as defineFlatConfig9 } from "eslint-define-config";
|
|
544
|
+
var imports = defineFlatConfig9([
|
|
533
545
|
{
|
|
534
546
|
plugins: {
|
|
535
547
|
import: default3
|
|
@@ -568,10 +580,11 @@ var imports = [
|
|
|
568
580
|
]
|
|
569
581
|
}
|
|
570
582
|
}
|
|
571
|
-
];
|
|
583
|
+
]);
|
|
572
584
|
|
|
573
585
|
// src/configs/unocss.ts
|
|
574
|
-
|
|
586
|
+
import { defineFlatConfig as defineFlatConfig10 } from "eslint-define-config";
|
|
587
|
+
var unocss = defineFlatConfig10([
|
|
575
588
|
{
|
|
576
589
|
plugins: {
|
|
577
590
|
"@unocss": default7
|
|
@@ -580,10 +593,11 @@ var unocss = [
|
|
|
580
593
|
...default7.configs.recommended.rules
|
|
581
594
|
}
|
|
582
595
|
}
|
|
583
|
-
];
|
|
596
|
+
]);
|
|
584
597
|
|
|
585
598
|
// src/configs/unicorn.ts
|
|
586
|
-
|
|
599
|
+
import { defineFlatConfig as defineFlatConfig11 } from "eslint-define-config";
|
|
600
|
+
var unicorn = defineFlatConfig11([
|
|
587
601
|
{
|
|
588
602
|
plugins: {
|
|
589
603
|
unicorn: default8
|
|
@@ -655,11 +669,12 @@ var unicorn = [
|
|
|
655
669
|
"unicorn/prefer-array-index-of": "error"
|
|
656
670
|
}
|
|
657
671
|
}
|
|
658
|
-
];
|
|
672
|
+
]);
|
|
659
673
|
|
|
660
674
|
// src/configs/prettier.ts
|
|
661
675
|
import prettierConfig from "eslint-config-prettier";
|
|
662
|
-
|
|
676
|
+
import { defineFlatConfig as defineFlatConfig12 } from "eslint-define-config";
|
|
677
|
+
var prettier = defineFlatConfig12([
|
|
663
678
|
{
|
|
664
679
|
plugins: {
|
|
665
680
|
prettier: default9
|
|
@@ -670,10 +685,11 @@ var prettier = [
|
|
|
670
685
|
"prettier/prettier": "warn"
|
|
671
686
|
}
|
|
672
687
|
}
|
|
673
|
-
];
|
|
688
|
+
]);
|
|
674
689
|
|
|
675
690
|
// src/configs/markdown.ts
|
|
676
|
-
|
|
691
|
+
import { defineFlatConfig as defineFlatConfig13 } from "eslint-define-config";
|
|
692
|
+
var markdown = defineFlatConfig13([
|
|
677
693
|
{
|
|
678
694
|
files: [GLOB_MARKDOWN],
|
|
679
695
|
plugins: {
|
|
@@ -712,10 +728,11 @@ var markdown = [
|
|
|
712
728
|
"unused-imports/no-unused-vars": "off"
|
|
713
729
|
}
|
|
714
730
|
}
|
|
715
|
-
];
|
|
731
|
+
]);
|
|
716
732
|
|
|
717
733
|
// src/configs/comments.ts
|
|
718
|
-
|
|
734
|
+
import { defineFlatConfig as defineFlatConfig14 } from "eslint-define-config";
|
|
735
|
+
var comments = defineFlatConfig14([
|
|
719
736
|
{
|
|
720
737
|
plugins: {
|
|
721
738
|
"eslint-comments": default12
|
|
@@ -725,12 +742,13 @@ var comments = [
|
|
|
725
742
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
726
743
|
}
|
|
727
744
|
}
|
|
728
|
-
];
|
|
745
|
+
]);
|
|
729
746
|
|
|
730
747
|
// src/configs/javascript.ts
|
|
731
748
|
import globals from "globals";
|
|
732
749
|
import jsConfig from "@eslint/js";
|
|
733
|
-
|
|
750
|
+
import { defineFlatConfig as defineFlatConfig15 } from "eslint-define-config";
|
|
751
|
+
var javascript = defineFlatConfig15([
|
|
734
752
|
jsConfig.configs.recommended,
|
|
735
753
|
{
|
|
736
754
|
languageOptions: {
|
|
@@ -1091,8 +1109,8 @@ var javascript = [
|
|
|
1091
1109
|
"max-lines-per-function": "off"
|
|
1092
1110
|
}
|
|
1093
1111
|
}
|
|
1094
|
-
];
|
|
1095
|
-
var jsx = [
|
|
1112
|
+
]);
|
|
1113
|
+
var jsx = defineFlatConfig15([
|
|
1096
1114
|
{
|
|
1097
1115
|
files: ["**/*.jsx"],
|
|
1098
1116
|
languageOptions: {
|
|
@@ -1103,17 +1121,18 @@ var jsx = [
|
|
|
1103
1121
|
}
|
|
1104
1122
|
}
|
|
1105
1123
|
}
|
|
1106
|
-
];
|
|
1124
|
+
]);
|
|
1107
1125
|
|
|
1108
1126
|
// src/configs/ignores.ts
|
|
1109
|
-
|
|
1127
|
+
import { defineFlatConfig as defineFlatConfig16 } from "eslint-define-config";
|
|
1128
|
+
var ignores = defineFlatConfig16([
|
|
1110
1129
|
{
|
|
1111
1130
|
ignores: GLOB_EXCLUDE
|
|
1112
1131
|
}
|
|
1113
|
-
];
|
|
1132
|
+
]);
|
|
1114
1133
|
|
|
1115
1134
|
// src/presets.ts
|
|
1116
|
-
var basic = [
|
|
1135
|
+
var basic = defineFlatConfig17([
|
|
1117
1136
|
...ignores,
|
|
1118
1137
|
...javascript,
|
|
1119
1138
|
...jsx,
|
|
@@ -1122,8 +1141,8 @@ var basic = [
|
|
|
1122
1141
|
...imports,
|
|
1123
1142
|
...unicorn,
|
|
1124
1143
|
...comments
|
|
1125
|
-
];
|
|
1126
|
-
var common = [
|
|
1144
|
+
]);
|
|
1145
|
+
var common = defineFlatConfig17([
|
|
1127
1146
|
...basic,
|
|
1128
1147
|
...yml,
|
|
1129
1148
|
...jsonc,
|
|
@@ -1131,15 +1150,15 @@ var common = [
|
|
|
1131
1150
|
...sortTsConfig,
|
|
1132
1151
|
...prettier,
|
|
1133
1152
|
...markdown
|
|
1134
|
-
];
|
|
1135
|
-
var all = [...common, ...vue, ...react, ...astro, ...unocss];
|
|
1153
|
+
]);
|
|
1154
|
+
var all = defineFlatConfig17([...common, ...vue, ...react, ...astro, ...unocss]);
|
|
1136
1155
|
function ntnyq(config = [], {
|
|
1137
1156
|
vue: enableVue = false,
|
|
1138
1157
|
react: enableReact = false,
|
|
1139
1158
|
astro: enableAstro = false,
|
|
1140
1159
|
unocss: enableUnoCSS = false
|
|
1141
1160
|
} = {}) {
|
|
1142
|
-
const configs = [...common];
|
|
1161
|
+
const configs = defineFlatConfig17([...common]);
|
|
1143
1162
|
if (enableVue) {
|
|
1144
1163
|
configs.push(...vue);
|
|
1145
1164
|
}
|
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.
|
|
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
58
|
"astro-eslint-parser": "^0.16.0",
|
|
59
59
|
"eslint-config-prettier": "^9.0.0",
|
|
60
|
-
"eslint-define-config": "^
|
|
60
|
+
"eslint-define-config": "^2.0.0",
|
|
61
61
|
"eslint-plugin-astro": "^0.29.1",
|
|
62
62
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
63
|
-
"eslint-plugin-i": "^2.
|
|
63
|
+
"eslint-plugin-i": "^2.29.0",
|
|
64
64
|
"eslint-plugin-jsonc": "^2.10.0",
|
|
65
65
|
"eslint-plugin-markdown": "^3.0.1",
|
|
66
|
-
"eslint-plugin-n": "^16.
|
|
66
|
+
"eslint-plugin-n": "^16.3.1",
|
|
67
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.
|
|
70
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
71
|
+
"eslint-plugin-vue": "^9.18.1",
|
|
72
72
|
"eslint-plugin-yml": "^1.10.0",
|
|
73
73
|
"globals": "^13.23.0",
|
|
74
|
-
"jsonc-eslint-parser": "^2.
|
|
74
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
75
75
|
"local-pkg": "^0.5.0",
|
|
76
|
-
"prettier": "^3.0
|
|
76
|
+
"prettier": "^3.1.0",
|
|
77
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
88
|
"rimraf": "^5.0.5",
|
|
89
|
-
"tsup": "^
|
|
89
|
+
"tsup": "^8.0.1",
|
|
90
90
|
"typescript": "5.2.2"
|
|
91
91
|
},
|
|
92
92
|
"engines": {
|