@ntnyq/eslint-config 3.0.0-beta.13 → 3.0.0-beta.15
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 +91 -66
- package/dist/index.d.cts +17 -7
- package/dist/index.d.ts +17 -7
- package/dist/index.js +90 -66
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -106,6 +106,7 @@ __export(src_exports, {
|
|
|
106
106
|
sortI18nLocale: () => sortI18nLocale,
|
|
107
107
|
sortPackageJson: () => sortPackageJson,
|
|
108
108
|
sortTsConfig: () => sortTsConfig,
|
|
109
|
+
test: () => test,
|
|
109
110
|
toArray: () => toArray,
|
|
110
111
|
toml: () => toml,
|
|
111
112
|
tseslint: () => import_typescript_eslint.default,
|
|
@@ -127,11 +128,16 @@ var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
|
127
128
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
128
129
|
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
129
130
|
var GLOB_JS = "**/*.?([cm])js";
|
|
130
|
-
var GLOB_JSX =
|
|
131
|
+
var GLOB_JSX = `${GLOB_JS}x`;
|
|
131
132
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
132
|
-
var GLOB_TSX =
|
|
133
|
+
var GLOB_TSX = `${GLOB_TS}x`;
|
|
133
134
|
var GLOB_DTS = "**/*.d.?([cm])ts";
|
|
134
|
-
var GLOB_TEST =
|
|
135
|
+
var GLOB_TEST = [
|
|
136
|
+
`**/*.test.${GLOB_SRC_EXT}`,
|
|
137
|
+
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
138
|
+
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
139
|
+
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
140
|
+
];
|
|
135
141
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
136
142
|
var GLOB_CSS = "**/*.css";
|
|
137
143
|
var GLOB_LESS = "**/*.less";
|
|
@@ -256,6 +262,29 @@ var typescriptCore = (options = {}) => {
|
|
|
256
262
|
}
|
|
257
263
|
},
|
|
258
264
|
rules: {
|
|
265
|
+
// Disabled in favor of ts rules
|
|
266
|
+
"no-redeclare": "off",
|
|
267
|
+
"no-use-before-define": "off",
|
|
268
|
+
"no-unused-vars": "off",
|
|
269
|
+
"@typescript-eslint/no-redeclare": [
|
|
270
|
+
"error",
|
|
271
|
+
{
|
|
272
|
+
builtinGlobals: false,
|
|
273
|
+
ignoreDeclarationMerge: true
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"@typescript-eslint/no-use-before-define": [
|
|
277
|
+
"error",
|
|
278
|
+
{
|
|
279
|
+
functions: false,
|
|
280
|
+
classes: false,
|
|
281
|
+
variables: true,
|
|
282
|
+
allowNamedExports: false,
|
|
283
|
+
enums: true,
|
|
284
|
+
typedefs: false,
|
|
285
|
+
ignoreTypeReferences: false
|
|
286
|
+
}
|
|
287
|
+
],
|
|
259
288
|
"@typescript-eslint/no-unused-vars": [
|
|
260
289
|
"error",
|
|
261
290
|
{
|
|
@@ -269,12 +298,6 @@ var typescriptCore = (options = {}) => {
|
|
|
269
298
|
ignoreRestSiblings: true
|
|
270
299
|
}
|
|
271
300
|
],
|
|
272
|
-
"@typescript-eslint/no-redeclare": [
|
|
273
|
-
"error",
|
|
274
|
-
{
|
|
275
|
-
builtinGlobals: false
|
|
276
|
-
}
|
|
277
|
-
],
|
|
278
301
|
"@typescript-eslint/no-unused-expressions": [
|
|
279
302
|
"error",
|
|
280
303
|
{
|
|
@@ -320,31 +343,24 @@ var typescriptCore = (options = {}) => {
|
|
|
320
343
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
321
344
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
322
345
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
323
|
-
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
346
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
347
|
+
// Overrides rules
|
|
348
|
+
...options.overrides
|
|
349
|
+
}
|
|
327
350
|
});
|
|
328
351
|
return configs;
|
|
329
352
|
};
|
|
330
353
|
var typescript = (options = {}) => [
|
|
331
354
|
...typescriptCore(options),
|
|
332
355
|
{
|
|
333
|
-
name: "ntnyq/ts/
|
|
356
|
+
name: "ntnyq/ts/types",
|
|
334
357
|
files: [GLOB_DTS, "**/types/**/*.ts"],
|
|
335
358
|
rules: {
|
|
336
359
|
"no-use-before-define": "off",
|
|
337
360
|
"no-restricted-syntax": "off",
|
|
338
361
|
"import/no-duplicates": "off",
|
|
339
|
-
"import/newline-after-import": "off"
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
name: "ntnyq/ts/test",
|
|
344
|
-
files: ["**/*.{spec,test}.ts?(x)"],
|
|
345
|
-
rules: {
|
|
346
|
-
"no-unused-expressions": "off",
|
|
347
|
-
"max-lines-per-function": "off"
|
|
362
|
+
"import/newline-after-import": "off",
|
|
363
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
348
364
|
}
|
|
349
365
|
}
|
|
350
366
|
];
|
|
@@ -617,7 +633,7 @@ var vue = (options = {}) => {
|
|
|
617
633
|
multiline: 1
|
|
618
634
|
}
|
|
619
635
|
],
|
|
620
|
-
// Overrides
|
|
636
|
+
// Overrides rules
|
|
621
637
|
...options.overrides
|
|
622
638
|
}
|
|
623
639
|
}
|
|
@@ -640,7 +656,7 @@ var yml = (options = {}) => [
|
|
|
640
656
|
...import_eslint_plugin_yml.default.configs.prettier.rules,
|
|
641
657
|
"yml/no-empty-mapping-value": "off",
|
|
642
658
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
|
|
643
|
-
// Overrides
|
|
659
|
+
// Overrides rules
|
|
644
660
|
...options.overrides
|
|
645
661
|
}
|
|
646
662
|
}
|
|
@@ -662,7 +678,7 @@ var node = (options = {}) => [
|
|
|
662
678
|
"node/prefer-global/buffer": ["error", "never"],
|
|
663
679
|
"node/prefer-global/process": ["error", "never"],
|
|
664
680
|
"node/process-exit-as-throw": "error",
|
|
665
|
-
// Overrides
|
|
681
|
+
// Overrides rules
|
|
666
682
|
...options.overrides
|
|
667
683
|
}
|
|
668
684
|
}
|
|
@@ -932,11 +948,39 @@ var toml = (options = {}) => [
|
|
|
932
948
|
"toml/quoted-keys": "error",
|
|
933
949
|
"toml/spaced-comment": "error",
|
|
934
950
|
"toml/table-bracket-spacing": "error",
|
|
935
|
-
// Overrides
|
|
951
|
+
// Overrides rules
|
|
952
|
+
...options.overrides
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
];
|
|
956
|
+
|
|
957
|
+
// src/configs/test.ts
|
|
958
|
+
var test = (options = {}) => [
|
|
959
|
+
{
|
|
960
|
+
name: "ntnyq/test",
|
|
961
|
+
files: [...GLOB_TEST],
|
|
962
|
+
rules: {
|
|
963
|
+
"no-unused-expressions": "off",
|
|
964
|
+
"max-lines-per-function": "off",
|
|
965
|
+
// Overrides rules
|
|
936
966
|
...options.overrides
|
|
937
967
|
}
|
|
938
968
|
}
|
|
939
969
|
];
|
|
970
|
+
var vitest = (options = {}) => [
|
|
971
|
+
{
|
|
972
|
+
name: "ntnyq/vitest",
|
|
973
|
+
plugins: {
|
|
974
|
+
vitest: import_eslint_plugin2.default
|
|
975
|
+
},
|
|
976
|
+
files: [...GLOB_TEST],
|
|
977
|
+
rules: {
|
|
978
|
+
...import_eslint_plugin2.default.configs.recommended.rules,
|
|
979
|
+
// Overrides rules
|
|
980
|
+
...options.overridesVitestRules
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
];
|
|
940
984
|
|
|
941
985
|
// src/configs/antfu.ts
|
|
942
986
|
var antfu = (options = {}) => [
|
|
@@ -980,7 +1024,7 @@ var jsdoc = (options = {}) => [
|
|
|
980
1024
|
"jsdoc/require-yields-check": "warn",
|
|
981
1025
|
"jsdoc/check-alignment": "warn",
|
|
982
1026
|
"jsdoc/multiline-blocks": "warn",
|
|
983
|
-
// Overrides
|
|
1027
|
+
// Overrides rules
|
|
984
1028
|
...options.overrides
|
|
985
1029
|
}
|
|
986
1030
|
}
|
|
@@ -1025,7 +1069,7 @@ var jsonc = (options = {}) => [
|
|
|
1025
1069
|
allowMultiplePropertiesPerLine: true
|
|
1026
1070
|
}
|
|
1027
1071
|
],
|
|
1028
|
-
// Overrides
|
|
1072
|
+
// Overrides rules
|
|
1029
1073
|
...options.overrides
|
|
1030
1074
|
}
|
|
1031
1075
|
}
|
|
@@ -1039,7 +1083,7 @@ var regexp = (options = {}) => [
|
|
|
1039
1083
|
{
|
|
1040
1084
|
name: "ntnyq/regexp",
|
|
1041
1085
|
...pluginRegexp.configs["flat/recommended"],
|
|
1042
|
-
// Overrides
|
|
1086
|
+
// Overrides rules
|
|
1043
1087
|
...options.overrides
|
|
1044
1088
|
}
|
|
1045
1089
|
];
|
|
@@ -1055,23 +1099,7 @@ var unocss = (options = {}) => [
|
|
|
1055
1099
|
"unocss/order": "error",
|
|
1056
1100
|
// We don't use this
|
|
1057
1101
|
"unocss/order-attributify": "off",
|
|
1058
|
-
// Overrides
|
|
1059
|
-
...options.overrides
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
];
|
|
1063
|
-
|
|
1064
|
-
// src/configs/vitest.ts
|
|
1065
|
-
var vitest = (options = {}) => [
|
|
1066
|
-
{
|
|
1067
|
-
name: "ntnyq/vitest",
|
|
1068
|
-
plugins: {
|
|
1069
|
-
vitest: import_eslint_plugin2.default
|
|
1070
|
-
},
|
|
1071
|
-
files: [GLOB_TEST],
|
|
1072
|
-
rules: {
|
|
1073
|
-
...import_eslint_plugin2.default.configs.recommended.rules,
|
|
1074
|
-
// Overrides built-in rules
|
|
1102
|
+
// Overrides rules
|
|
1075
1103
|
...options.overrides
|
|
1076
1104
|
}
|
|
1077
1105
|
}
|
|
@@ -1123,7 +1151,7 @@ var imports = (options = {}) => [
|
|
|
1123
1151
|
"import/no-duplicates": "error",
|
|
1124
1152
|
"import/no-mutable-exports": "error",
|
|
1125
1153
|
"import/newline-after-import": "error",
|
|
1126
|
-
// Overrides
|
|
1154
|
+
// Overrides rules
|
|
1127
1155
|
...options.overrides
|
|
1128
1156
|
}
|
|
1129
1157
|
}
|
|
@@ -1201,7 +1229,7 @@ var unicorn = (options = {}) => [
|
|
|
1201
1229
|
"unicorn/prefer-array-some": "error",
|
|
1202
1230
|
"unicorn/prefer-array-flat-map": "error",
|
|
1203
1231
|
"unicorn/prefer-array-index-of": "error",
|
|
1204
|
-
// Overrides
|
|
1232
|
+
// Overrides rules
|
|
1205
1233
|
...options.overrides
|
|
1206
1234
|
}
|
|
1207
1235
|
}
|
|
@@ -1237,7 +1265,7 @@ var comments = (options = {}) => [
|
|
|
1237
1265
|
rules: {
|
|
1238
1266
|
...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
|
|
1239
1267
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
1240
|
-
// Overrides
|
|
1268
|
+
// Overrides rules
|
|
1241
1269
|
...options.overrides
|
|
1242
1270
|
}
|
|
1243
1271
|
}
|
|
@@ -1275,7 +1303,7 @@ var markdown = (options = {}) => {
|
|
|
1275
1303
|
"@typescript-eslint/no-use-before-define": "off",
|
|
1276
1304
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
1277
1305
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
1278
|
-
// Overrides
|
|
1306
|
+
// Overrides rules
|
|
1279
1307
|
...options.overrides
|
|
1280
1308
|
}
|
|
1281
1309
|
}
|
|
@@ -1329,7 +1357,7 @@ var prettier = (options = {}) => [
|
|
|
1329
1357
|
"vue/template-curly-spacing": "off",
|
|
1330
1358
|
...import_eslint_plugin_prettier.default.configs.recommended.rules,
|
|
1331
1359
|
"prettier/prettier": options.level || "warn",
|
|
1332
|
-
// Overrides
|
|
1360
|
+
// Overrides rules
|
|
1333
1361
|
...options.overrides
|
|
1334
1362
|
}
|
|
1335
1363
|
},
|
|
@@ -1564,22 +1592,15 @@ var javascript = (options = {}) => {
|
|
|
1564
1592
|
{
|
|
1565
1593
|
functions: false,
|
|
1566
1594
|
classes: false,
|
|
1567
|
-
variables: true
|
|
1595
|
+
variables: true,
|
|
1596
|
+
allowNamedExports: false
|
|
1568
1597
|
}
|
|
1569
1598
|
],
|
|
1570
1599
|
// Strict rules
|
|
1571
1600
|
...options.strict ? strictRules : {},
|
|
1572
|
-
// Overrides
|
|
1601
|
+
// Overrides rules
|
|
1573
1602
|
...options.overrides
|
|
1574
1603
|
}
|
|
1575
|
-
},
|
|
1576
|
-
{
|
|
1577
|
-
name: "ntnyq/js/test",
|
|
1578
|
-
files: ["**/*.{test,spec}.js?(x)"],
|
|
1579
|
-
rules: {
|
|
1580
|
-
"no-unused-expressions": "off",
|
|
1581
|
-
"max-lines-per-function": "off"
|
|
1582
|
-
}
|
|
1583
1604
|
}
|
|
1584
1605
|
];
|
|
1585
1606
|
};
|
|
@@ -1677,7 +1698,7 @@ var perfectionist = (options = {}) => [
|
|
|
1677
1698
|
groupKind: "values-first"
|
|
1678
1699
|
}
|
|
1679
1700
|
],
|
|
1680
|
-
// Overrides
|
|
1701
|
+
// Overrides rules
|
|
1681
1702
|
...options.overrides
|
|
1682
1703
|
}
|
|
1683
1704
|
}
|
|
@@ -1706,7 +1727,7 @@ var unusedImports = (options = {}) => [
|
|
|
1706
1727
|
caughtErrorsIgnorePattern: "^_"
|
|
1707
1728
|
}
|
|
1708
1729
|
],
|
|
1709
|
-
// Overrides
|
|
1730
|
+
// Overrides rules
|
|
1710
1731
|
...options.overrides
|
|
1711
1732
|
}
|
|
1712
1733
|
}
|
|
@@ -1861,10 +1882,13 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1861
1882
|
})
|
|
1862
1883
|
);
|
|
1863
1884
|
}
|
|
1864
|
-
if (options.
|
|
1885
|
+
if (options.test ?? hasVitest) {
|
|
1865
1886
|
configs.push(
|
|
1887
|
+
...test({
|
|
1888
|
+
overrides: getOverrides(options, "test")
|
|
1889
|
+
}),
|
|
1866
1890
|
...vitest({
|
|
1867
|
-
overrides: getOverrides(options, "
|
|
1891
|
+
overrides: getOverrides(options, "test")
|
|
1868
1892
|
})
|
|
1869
1893
|
);
|
|
1870
1894
|
}
|
|
@@ -1981,6 +2005,7 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1981
2005
|
sortI18nLocale,
|
|
1982
2006
|
sortPackageJson,
|
|
1983
2007
|
sortTsConfig,
|
|
2008
|
+
test,
|
|
1984
2009
|
toArray,
|
|
1985
2010
|
toml,
|
|
1986
2011
|
tseslint,
|
package/dist/index.d.cts
CHANGED
|
@@ -780,6 +780,11 @@ interface RuleOptions {
|
|
|
780
780
|
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
|
|
781
781
|
*/
|
|
782
782
|
'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>;
|
|
783
|
+
/**
|
|
784
|
+
* Prevent using top-level await
|
|
785
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
|
|
786
|
+
*/
|
|
787
|
+
'antfu/no-top-level-await'?: Linter.RuleEntry<[]>;
|
|
783
788
|
/**
|
|
784
789
|
* Do not use `exports =`
|
|
785
790
|
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
|
|
@@ -12206,7 +12211,7 @@ type Yoda = [] | [("always" | "never")] | [
|
|
|
12206
12211
|
onlyEquality?: boolean;
|
|
12207
12212
|
}
|
|
12208
12213
|
];
|
|
12209
|
-
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/
|
|
12214
|
+
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
12210
12215
|
|
|
12211
12216
|
/**
|
|
12212
12217
|
* Typed flat config item
|
|
@@ -12319,7 +12324,11 @@ interface ConfigVueOptions extends OptionsOverrides {
|
|
|
12319
12324
|
*/
|
|
12320
12325
|
vueVersion?: 2 | 3;
|
|
12321
12326
|
}
|
|
12322
|
-
interface
|
|
12327
|
+
interface ConfigTestOptions extends OptionsOverrides {
|
|
12328
|
+
/**
|
|
12329
|
+
* Rules for vitest
|
|
12330
|
+
*/
|
|
12331
|
+
overridesVitestRules?: TypedConfigItem['rules'];
|
|
12323
12332
|
}
|
|
12324
12333
|
interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
12325
12334
|
}
|
|
@@ -12357,7 +12366,7 @@ interface ConfigOptions {
|
|
|
12357
12366
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
12358
12367
|
toml?: boolean | ConfigTomlOptions;
|
|
12359
12368
|
vue?: boolean | ConfigVueOptions;
|
|
12360
|
-
|
|
12369
|
+
test?: boolean | ConfigTestOptions;
|
|
12361
12370
|
}
|
|
12362
12371
|
|
|
12363
12372
|
/**
|
|
@@ -12379,7 +12388,7 @@ declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
|
12379
12388
|
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
12380
12389
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
12381
12390
|
declare const GLOB_DTS = "**/*.d.?([cm])ts";
|
|
12382
|
-
declare const GLOB_TEST
|
|
12391
|
+
declare const GLOB_TEST: string[];
|
|
12383
12392
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
12384
12393
|
declare const GLOB_CSS = "**/*.css";
|
|
12385
12394
|
declare const GLOB_LESS = "**/*.less";
|
|
@@ -12437,6 +12446,9 @@ declare const sortI18nLocale: () => TypedConfigItem[];
|
|
|
12437
12446
|
|
|
12438
12447
|
declare const toml: (options?: ConfigTomlOptions) => TypedConfigItem[];
|
|
12439
12448
|
|
|
12449
|
+
declare const test: (options?: ConfigTestOptions) => TypedConfigItem[];
|
|
12450
|
+
declare const vitest: (options?: ConfigTestOptions) => TypedConfigItem[];
|
|
12451
|
+
|
|
12440
12452
|
declare const antfu: (options?: ConfigAntfuOptions) => TypedConfigItem[];
|
|
12441
12453
|
|
|
12442
12454
|
declare const jsdoc: (options?: ConfigJsdocOptions) => TypedConfigItem[];
|
|
@@ -12447,8 +12459,6 @@ declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
|
|
|
12447
12459
|
|
|
12448
12460
|
declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
|
|
12449
12461
|
|
|
12450
|
-
declare const vitest: (options?: ConfigVitestOptions) => TypedConfigItem[];
|
|
12451
|
-
|
|
12452
12462
|
declare const command: (options?: ConfigCommandOptions) => TypedConfigItem[];
|
|
12453
12463
|
|
|
12454
12464
|
/**
|
|
@@ -12480,4 +12490,4 @@ declare const perfectionist: (options?: ConfigPerfectionistOptions) => TypedConf
|
|
|
12480
12490
|
|
|
12481
12491
|
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConfigItem[];
|
|
12482
12492
|
|
|
12483
|
-
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type
|
|
12493
|
+
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type LiteralUnion, type OptionsFiles, type OptionsOverrides, type ParserOptions, type PerfectionistSortOrder, type PerfectionistSortType, type ResolvedOptions, type RuleOptions, type TypedConfigItem, antfu, command, comments, disables, getOverrides, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, test, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -780,6 +780,11 @@ interface RuleOptions {
|
|
|
780
780
|
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
|
|
781
781
|
*/
|
|
782
782
|
'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>;
|
|
783
|
+
/**
|
|
784
|
+
* Prevent using top-level await
|
|
785
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
|
|
786
|
+
*/
|
|
787
|
+
'antfu/no-top-level-await'?: Linter.RuleEntry<[]>;
|
|
783
788
|
/**
|
|
784
789
|
* Do not use `exports =`
|
|
785
790
|
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
|
|
@@ -12206,7 +12211,7 @@ type Yoda = [] | [("always" | "never")] | [
|
|
|
12206
12211
|
onlyEquality?: boolean;
|
|
12207
12212
|
}
|
|
12208
12213
|
];
|
|
12209
|
-
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/
|
|
12214
|
+
type ConfigNames = 'ntnyq/antfu' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/types' | 'ntnyq/unused-imports' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
12210
12215
|
|
|
12211
12216
|
/**
|
|
12212
12217
|
* Typed flat config item
|
|
@@ -12319,7 +12324,11 @@ interface ConfigVueOptions extends OptionsOverrides {
|
|
|
12319
12324
|
*/
|
|
12320
12325
|
vueVersion?: 2 | 3;
|
|
12321
12326
|
}
|
|
12322
|
-
interface
|
|
12327
|
+
interface ConfigTestOptions extends OptionsOverrides {
|
|
12328
|
+
/**
|
|
12329
|
+
* Rules for vitest
|
|
12330
|
+
*/
|
|
12331
|
+
overridesVitestRules?: TypedConfigItem['rules'];
|
|
12323
12332
|
}
|
|
12324
12333
|
interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
12325
12334
|
}
|
|
@@ -12357,7 +12366,7 @@ interface ConfigOptions {
|
|
|
12357
12366
|
markdown?: boolean | ConfigMarkdownOptions;
|
|
12358
12367
|
toml?: boolean | ConfigTomlOptions;
|
|
12359
12368
|
vue?: boolean | ConfigVueOptions;
|
|
12360
|
-
|
|
12369
|
+
test?: boolean | ConfigTestOptions;
|
|
12361
12370
|
}
|
|
12362
12371
|
|
|
12363
12372
|
/**
|
|
@@ -12379,7 +12388,7 @@ declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
|
12379
12388
|
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
12380
12389
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
12381
12390
|
declare const GLOB_DTS = "**/*.d.?([cm])ts";
|
|
12382
|
-
declare const GLOB_TEST
|
|
12391
|
+
declare const GLOB_TEST: string[];
|
|
12383
12392
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
12384
12393
|
declare const GLOB_CSS = "**/*.css";
|
|
12385
12394
|
declare const GLOB_LESS = "**/*.less";
|
|
@@ -12437,6 +12446,9 @@ declare const sortI18nLocale: () => TypedConfigItem[];
|
|
|
12437
12446
|
|
|
12438
12447
|
declare const toml: (options?: ConfigTomlOptions) => TypedConfigItem[];
|
|
12439
12448
|
|
|
12449
|
+
declare const test: (options?: ConfigTestOptions) => TypedConfigItem[];
|
|
12450
|
+
declare const vitest: (options?: ConfigTestOptions) => TypedConfigItem[];
|
|
12451
|
+
|
|
12440
12452
|
declare const antfu: (options?: ConfigAntfuOptions) => TypedConfigItem[];
|
|
12441
12453
|
|
|
12442
12454
|
declare const jsdoc: (options?: ConfigJsdocOptions) => TypedConfigItem[];
|
|
@@ -12447,8 +12459,6 @@ declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
|
|
|
12447
12459
|
|
|
12448
12460
|
declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
|
|
12449
12461
|
|
|
12450
|
-
declare const vitest: (options?: ConfigVitestOptions) => TypedConfigItem[];
|
|
12451
|
-
|
|
12452
12462
|
declare const command: (options?: ConfigCommandOptions) => TypedConfigItem[];
|
|
12453
12463
|
|
|
12454
12464
|
/**
|
|
@@ -12480,4 +12490,4 @@ declare const perfectionist: (options?: ConfigPerfectionistOptions) => TypedConf
|
|
|
12480
12490
|
|
|
12481
12491
|
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConfigItem[];
|
|
12482
12492
|
|
|
12483
|
-
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type
|
|
12493
|
+
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type LiteralUnion, type OptionsFiles, type OptionsOverrides, type ParserOptions, type PerfectionistSortOrder, type PerfectionistSortType, type ResolvedOptions, type RuleOptions, type TypedConfigItem, antfu, command, comments, disables, getOverrides, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, test, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,16 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
5
5
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
6
6
|
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
7
7
|
var GLOB_JS = "**/*.?([cm])js";
|
|
8
|
-
var GLOB_JSX =
|
|
8
|
+
var GLOB_JSX = `${GLOB_JS}x`;
|
|
9
9
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
10
|
-
var GLOB_TSX =
|
|
10
|
+
var GLOB_TSX = `${GLOB_TS}x`;
|
|
11
11
|
var GLOB_DTS = "**/*.d.?([cm])ts";
|
|
12
|
-
var GLOB_TEST =
|
|
12
|
+
var GLOB_TEST = [
|
|
13
|
+
`**/*.test.${GLOB_SRC_EXT}`,
|
|
14
|
+
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
15
|
+
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
16
|
+
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
17
|
+
];
|
|
13
18
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
14
19
|
var GLOB_CSS = "**/*.css";
|
|
15
20
|
var GLOB_LESS = "**/*.less";
|
|
@@ -134,6 +139,29 @@ var typescriptCore = (options = {}) => {
|
|
|
134
139
|
}
|
|
135
140
|
},
|
|
136
141
|
rules: {
|
|
142
|
+
// Disabled in favor of ts rules
|
|
143
|
+
"no-redeclare": "off",
|
|
144
|
+
"no-use-before-define": "off",
|
|
145
|
+
"no-unused-vars": "off",
|
|
146
|
+
"@typescript-eslint/no-redeclare": [
|
|
147
|
+
"error",
|
|
148
|
+
{
|
|
149
|
+
builtinGlobals: false,
|
|
150
|
+
ignoreDeclarationMerge: true
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"@typescript-eslint/no-use-before-define": [
|
|
154
|
+
"error",
|
|
155
|
+
{
|
|
156
|
+
functions: false,
|
|
157
|
+
classes: false,
|
|
158
|
+
variables: true,
|
|
159
|
+
allowNamedExports: false,
|
|
160
|
+
enums: true,
|
|
161
|
+
typedefs: false,
|
|
162
|
+
ignoreTypeReferences: false
|
|
163
|
+
}
|
|
164
|
+
],
|
|
137
165
|
"@typescript-eslint/no-unused-vars": [
|
|
138
166
|
"error",
|
|
139
167
|
{
|
|
@@ -147,12 +175,6 @@ var typescriptCore = (options = {}) => {
|
|
|
147
175
|
ignoreRestSiblings: true
|
|
148
176
|
}
|
|
149
177
|
],
|
|
150
|
-
"@typescript-eslint/no-redeclare": [
|
|
151
|
-
"error",
|
|
152
|
-
{
|
|
153
|
-
builtinGlobals: false
|
|
154
|
-
}
|
|
155
|
-
],
|
|
156
178
|
"@typescript-eslint/no-unused-expressions": [
|
|
157
179
|
"error",
|
|
158
180
|
{
|
|
@@ -198,31 +220,24 @@ var typescriptCore = (options = {}) => {
|
|
|
198
220
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
199
221
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
200
222
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
201
|
-
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
223
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
224
|
+
// Overrides rules
|
|
225
|
+
...options.overrides
|
|
226
|
+
}
|
|
205
227
|
});
|
|
206
228
|
return configs;
|
|
207
229
|
};
|
|
208
230
|
var typescript = (options = {}) => [
|
|
209
231
|
...typescriptCore(options),
|
|
210
232
|
{
|
|
211
|
-
name: "ntnyq/ts/
|
|
233
|
+
name: "ntnyq/ts/types",
|
|
212
234
|
files: [GLOB_DTS, "**/types/**/*.ts"],
|
|
213
235
|
rules: {
|
|
214
236
|
"no-use-before-define": "off",
|
|
215
237
|
"no-restricted-syntax": "off",
|
|
216
238
|
"import/no-duplicates": "off",
|
|
217
|
-
"import/newline-after-import": "off"
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
name: "ntnyq/ts/test",
|
|
222
|
-
files: ["**/*.{spec,test}.ts?(x)"],
|
|
223
|
-
rules: {
|
|
224
|
-
"no-unused-expressions": "off",
|
|
225
|
-
"max-lines-per-function": "off"
|
|
239
|
+
"import/newline-after-import": "off",
|
|
240
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
226
241
|
}
|
|
227
242
|
}
|
|
228
243
|
];
|
|
@@ -495,7 +510,7 @@ var vue = (options = {}) => {
|
|
|
495
510
|
multiline: 1
|
|
496
511
|
}
|
|
497
512
|
],
|
|
498
|
-
// Overrides
|
|
513
|
+
// Overrides rules
|
|
499
514
|
...options.overrides
|
|
500
515
|
}
|
|
501
516
|
}
|
|
@@ -518,7 +533,7 @@ var yml = (options = {}) => [
|
|
|
518
533
|
...default4.configs.prettier.rules,
|
|
519
534
|
"yml/no-empty-mapping-value": "off",
|
|
520
535
|
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
|
|
521
|
-
// Overrides
|
|
536
|
+
// Overrides rules
|
|
522
537
|
...options.overrides
|
|
523
538
|
}
|
|
524
539
|
}
|
|
@@ -540,7 +555,7 @@ var node = (options = {}) => [
|
|
|
540
555
|
"node/prefer-global/buffer": ["error", "never"],
|
|
541
556
|
"node/prefer-global/process": ["error", "never"],
|
|
542
557
|
"node/process-exit-as-throw": "error",
|
|
543
|
-
// Overrides
|
|
558
|
+
// Overrides rules
|
|
544
559
|
...options.overrides
|
|
545
560
|
}
|
|
546
561
|
}
|
|
@@ -810,11 +825,39 @@ var toml = (options = {}) => [
|
|
|
810
825
|
"toml/quoted-keys": "error",
|
|
811
826
|
"toml/spaced-comment": "error",
|
|
812
827
|
"toml/table-bracket-spacing": "error",
|
|
813
|
-
// Overrides
|
|
828
|
+
// Overrides rules
|
|
829
|
+
...options.overrides
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
];
|
|
833
|
+
|
|
834
|
+
// src/configs/test.ts
|
|
835
|
+
var test = (options = {}) => [
|
|
836
|
+
{
|
|
837
|
+
name: "ntnyq/test",
|
|
838
|
+
files: [...GLOB_TEST],
|
|
839
|
+
rules: {
|
|
840
|
+
"no-unused-expressions": "off",
|
|
841
|
+
"max-lines-per-function": "off",
|
|
842
|
+
// Overrides rules
|
|
814
843
|
...options.overrides
|
|
815
844
|
}
|
|
816
845
|
}
|
|
817
846
|
];
|
|
847
|
+
var vitest = (options = {}) => [
|
|
848
|
+
{
|
|
849
|
+
name: "ntnyq/vitest",
|
|
850
|
+
plugins: {
|
|
851
|
+
vitest: default11
|
|
852
|
+
},
|
|
853
|
+
files: [...GLOB_TEST],
|
|
854
|
+
rules: {
|
|
855
|
+
...default11.configs.recommended.rules,
|
|
856
|
+
// Overrides rules
|
|
857
|
+
...options.overridesVitestRules
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
];
|
|
818
861
|
|
|
819
862
|
// src/configs/antfu.ts
|
|
820
863
|
var antfu = (options = {}) => [
|
|
@@ -858,7 +901,7 @@ var jsdoc = (options = {}) => [
|
|
|
858
901
|
"jsdoc/require-yields-check": "warn",
|
|
859
902
|
"jsdoc/check-alignment": "warn",
|
|
860
903
|
"jsdoc/multiline-blocks": "warn",
|
|
861
|
-
// Overrides
|
|
904
|
+
// Overrides rules
|
|
862
905
|
...options.overrides
|
|
863
906
|
}
|
|
864
907
|
}
|
|
@@ -903,7 +946,7 @@ var jsonc = (options = {}) => [
|
|
|
903
946
|
allowMultiplePropertiesPerLine: true
|
|
904
947
|
}
|
|
905
948
|
],
|
|
906
|
-
// Overrides
|
|
949
|
+
// Overrides rules
|
|
907
950
|
...options.overrides
|
|
908
951
|
}
|
|
909
952
|
}
|
|
@@ -917,7 +960,7 @@ var regexp = (options = {}) => [
|
|
|
917
960
|
{
|
|
918
961
|
name: "ntnyq/regexp",
|
|
919
962
|
...pluginRegexp.configs["flat/recommended"],
|
|
920
|
-
// Overrides
|
|
963
|
+
// Overrides rules
|
|
921
964
|
...options.overrides
|
|
922
965
|
}
|
|
923
966
|
];
|
|
@@ -933,23 +976,7 @@ var unocss = (options = {}) => [
|
|
|
933
976
|
"unocss/order": "error",
|
|
934
977
|
// We don't use this
|
|
935
978
|
"unocss/order-attributify": "off",
|
|
936
|
-
// Overrides
|
|
937
|
-
...options.overrides
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
];
|
|
941
|
-
|
|
942
|
-
// src/configs/vitest.ts
|
|
943
|
-
var vitest = (options = {}) => [
|
|
944
|
-
{
|
|
945
|
-
name: "ntnyq/vitest",
|
|
946
|
-
plugins: {
|
|
947
|
-
vitest: default11
|
|
948
|
-
},
|
|
949
|
-
files: [GLOB_TEST],
|
|
950
|
-
rules: {
|
|
951
|
-
...default11.configs.recommended.rules,
|
|
952
|
-
// Overrides built-in rules
|
|
979
|
+
// Overrides rules
|
|
953
980
|
...options.overrides
|
|
954
981
|
}
|
|
955
982
|
}
|
|
@@ -1001,7 +1028,7 @@ var imports = (options = {}) => [
|
|
|
1001
1028
|
"import/no-duplicates": "error",
|
|
1002
1029
|
"import/no-mutable-exports": "error",
|
|
1003
1030
|
"import/newline-after-import": "error",
|
|
1004
|
-
// Overrides
|
|
1031
|
+
// Overrides rules
|
|
1005
1032
|
...options.overrides
|
|
1006
1033
|
}
|
|
1007
1034
|
}
|
|
@@ -1079,7 +1106,7 @@ var unicorn = (options = {}) => [
|
|
|
1079
1106
|
"unicorn/prefer-array-some": "error",
|
|
1080
1107
|
"unicorn/prefer-array-flat-map": "error",
|
|
1081
1108
|
"unicorn/prefer-array-index-of": "error",
|
|
1082
|
-
// Overrides
|
|
1109
|
+
// Overrides rules
|
|
1083
1110
|
...options.overrides
|
|
1084
1111
|
}
|
|
1085
1112
|
}
|
|
@@ -1115,7 +1142,7 @@ var comments = (options = {}) => [
|
|
|
1115
1142
|
rules: {
|
|
1116
1143
|
...default17.configs.recommended.rules,
|
|
1117
1144
|
"@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
1118
|
-
// Overrides
|
|
1145
|
+
// Overrides rules
|
|
1119
1146
|
...options.overrides
|
|
1120
1147
|
}
|
|
1121
1148
|
}
|
|
@@ -1153,7 +1180,7 @@ var markdown = (options = {}) => {
|
|
|
1153
1180
|
"@typescript-eslint/no-use-before-define": "off",
|
|
1154
1181
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
1155
1182
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
1156
|
-
// Overrides
|
|
1183
|
+
// Overrides rules
|
|
1157
1184
|
...options.overrides
|
|
1158
1185
|
}
|
|
1159
1186
|
}
|
|
@@ -1207,7 +1234,7 @@ var prettier = (options = {}) => [
|
|
|
1207
1234
|
"vue/template-curly-spacing": "off",
|
|
1208
1235
|
...default14.configs.recommended.rules,
|
|
1209
1236
|
"prettier/prettier": options.level || "warn",
|
|
1210
|
-
// Overrides
|
|
1237
|
+
// Overrides rules
|
|
1211
1238
|
...options.overrides
|
|
1212
1239
|
}
|
|
1213
1240
|
},
|
|
@@ -1442,22 +1469,15 @@ var javascript = (options = {}) => {
|
|
|
1442
1469
|
{
|
|
1443
1470
|
functions: false,
|
|
1444
1471
|
classes: false,
|
|
1445
|
-
variables: true
|
|
1472
|
+
variables: true,
|
|
1473
|
+
allowNamedExports: false
|
|
1446
1474
|
}
|
|
1447
1475
|
],
|
|
1448
1476
|
// Strict rules
|
|
1449
1477
|
...options.strict ? strictRules : {},
|
|
1450
|
-
// Overrides
|
|
1478
|
+
// Overrides rules
|
|
1451
1479
|
...options.overrides
|
|
1452
1480
|
}
|
|
1453
|
-
},
|
|
1454
|
-
{
|
|
1455
|
-
name: "ntnyq/js/test",
|
|
1456
|
-
files: ["**/*.{test,spec}.js?(x)"],
|
|
1457
|
-
rules: {
|
|
1458
|
-
"no-unused-expressions": "off",
|
|
1459
|
-
"max-lines-per-function": "off"
|
|
1460
|
-
}
|
|
1461
1481
|
}
|
|
1462
1482
|
];
|
|
1463
1483
|
};
|
|
@@ -1555,7 +1575,7 @@ var perfectionist = (options = {}) => [
|
|
|
1555
1575
|
groupKind: "values-first"
|
|
1556
1576
|
}
|
|
1557
1577
|
],
|
|
1558
|
-
// Overrides
|
|
1578
|
+
// Overrides rules
|
|
1559
1579
|
...options.overrides
|
|
1560
1580
|
}
|
|
1561
1581
|
}
|
|
@@ -1584,7 +1604,7 @@ var unusedImports = (options = {}) => [
|
|
|
1584
1604
|
caughtErrorsIgnorePattern: "^_"
|
|
1585
1605
|
}
|
|
1586
1606
|
],
|
|
1587
|
-
// Overrides
|
|
1607
|
+
// Overrides rules
|
|
1588
1608
|
...options.overrides
|
|
1589
1609
|
}
|
|
1590
1610
|
}
|
|
@@ -1739,10 +1759,13 @@ function ntnyq(options = {}, userConfigs = []) {
|
|
|
1739
1759
|
})
|
|
1740
1760
|
);
|
|
1741
1761
|
}
|
|
1742
|
-
if (options.
|
|
1762
|
+
if (options.test ?? hasVitest) {
|
|
1743
1763
|
configs.push(
|
|
1764
|
+
...test({
|
|
1765
|
+
overrides: getOverrides(options, "test")
|
|
1766
|
+
}),
|
|
1744
1767
|
...vitest({
|
|
1745
|
-
overrides: getOverrides(options, "
|
|
1768
|
+
overrides: getOverrides(options, "test")
|
|
1746
1769
|
})
|
|
1747
1770
|
);
|
|
1748
1771
|
}
|
|
@@ -1858,6 +1881,7 @@ export {
|
|
|
1858
1881
|
sortI18nLocale,
|
|
1859
1882
|
sortPackageJson,
|
|
1860
1883
|
sortTsConfig,
|
|
1884
|
+
test,
|
|
1861
1885
|
toArray,
|
|
1862
1886
|
toml,
|
|
1863
1887
|
tseslint,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "3.0.0-beta.15",
|
|
5
|
+
"packageManager": "pnpm@9.11.0",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
59
|
-
"@eslint/js": "^9.
|
|
59
|
+
"@eslint/js": "^9.11.0",
|
|
60
60
|
"@eslint/markdown": "^6.1.0",
|
|
61
61
|
"@types/eslint__js": "^8.42.3",
|
|
62
62
|
"@unocss/eslint-plugin": "^0.62.4",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
65
65
|
"eslint-flat-config-utils": "^0.4.0",
|
|
66
66
|
"eslint-merge-processors": "^0.1.0",
|
|
67
|
-
"eslint-plugin-antfu": "^2.
|
|
67
|
+
"eslint-plugin-antfu": "^2.7.0",
|
|
68
68
|
"eslint-plugin-command": "^0.2.5",
|
|
69
69
|
"eslint-plugin-import-x": "^4.2.1",
|
|
70
|
-
"eslint-plugin-jsdoc": "^50.2.
|
|
70
|
+
"eslint-plugin-jsdoc": "^50.2.4",
|
|
71
71
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
72
|
-
"eslint-plugin-n": "^17.10.
|
|
72
|
+
"eslint-plugin-n": "^17.10.3",
|
|
73
73
|
"eslint-plugin-perfectionist": "^3.6.0",
|
|
74
74
|
"eslint-plugin-prettier": "^5.2.1",
|
|
75
75
|
"eslint-plugin-regexp": "^2.6.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@ntnyq/prettier-config": "^1.21.3",
|
|
92
92
|
"@types/node": "^22.5.5",
|
|
93
93
|
"bumpp": "^9.5.2",
|
|
94
|
-
"eslint": "^9.
|
|
94
|
+
"eslint": "^9.11.0",
|
|
95
95
|
"eslint-typegen": "^0.3.2",
|
|
96
96
|
"husky": "^9.1.6",
|
|
97
97
|
"jiti": "^1.21.6",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"tsup": "^8.3.0",
|
|
102
102
|
"tsx": "^4.19.1",
|
|
103
103
|
"typescript": "^5.6.2",
|
|
104
|
-
"zx": "^8.1.
|
|
104
|
+
"zx": "^8.1.8"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
107
|
"node": ">=18.18.0"
|