@antfu/eslint-config 1.1.1 → 1.1.2
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/cli.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +4 -2
- package/package.json +10 -7
package/dist/cli.cjs
CHANGED
|
@@ -46,7 +46,7 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
|
46
46
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
47
47
|
|
|
48
48
|
// package.json
|
|
49
|
-
var version = "1.1.
|
|
49
|
+
var version = "1.1.2";
|
|
50
50
|
|
|
51
51
|
// src/cli/constants.ts
|
|
52
52
|
var ARROW = import_picocolors.default.cyan("\u2192");
|
|
@@ -211,7 +211,7 @@ ${antfuConfig}
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
console.log(import_picocolors2.default.green(`${CHECK} migration completed`));
|
|
214
|
-
console.log(`
|
|
214
|
+
console.log(`Now you can update the dependencies and run ${import_picocolors2.default.blue("eslint . --fix")}
|
|
215
215
|
`);
|
|
216
216
|
}
|
|
217
217
|
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import parse from "parse-gitignore";
|
|
|
17
17
|
import c from "picocolors";
|
|
18
18
|
|
|
19
19
|
// package.json
|
|
20
|
-
var version = "1.1.
|
|
20
|
+
var version = "1.1.2";
|
|
21
21
|
|
|
22
22
|
// src/cli/constants.ts
|
|
23
23
|
var ARROW = c.cyan("\u2192");
|
|
@@ -182,7 +182,7 @@ ${antfuConfig}
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
console.log(c2.green(`${CHECK} migration completed`));
|
|
185
|
-
console.log(`
|
|
185
|
+
console.log(`Now you can update the dependencies and run ${c2.blue("eslint . --fix")}
|
|
186
186
|
`);
|
|
187
187
|
}
|
|
188
188
|
|
package/dist/index.cjs
CHANGED
|
@@ -597,13 +597,15 @@ function markdown(options = {}) {
|
|
|
597
597
|
},
|
|
598
598
|
name: "antfu:markdown:rules",
|
|
599
599
|
rules: {
|
|
600
|
-
"antfu/no-cjs-exports": "off",
|
|
601
600
|
"antfu/no-ts-export-equal": "off",
|
|
602
601
|
"import/newline-after-import": "off",
|
|
603
602
|
"no-alert": "off",
|
|
604
603
|
"no-console": "off",
|
|
604
|
+
"no-labels": "off",
|
|
605
|
+
"no-restricted-syntax": "off",
|
|
605
606
|
"no-undef": "off",
|
|
606
607
|
"no-unused-expressions": "off",
|
|
608
|
+
"no-unused-labels": "off",
|
|
607
609
|
"no-unused-vars": "off",
|
|
608
610
|
"node/prefer-global/process": "off",
|
|
609
611
|
"style/comma-dangle": "off",
|
|
@@ -1131,7 +1133,6 @@ function typescript(options) {
|
|
|
1131
1133
|
),
|
|
1132
1134
|
"antfu/generic-spacing": "error",
|
|
1133
1135
|
"antfu/named-tuple-spacing": "error",
|
|
1134
|
-
"antfu/no-cjs-exports": "error",
|
|
1135
1136
|
"no-dupe-class-members": "off",
|
|
1136
1137
|
"no-invalid-this": "off",
|
|
1137
1138
|
"no-loss-of-precision": "off",
|
|
@@ -1423,6 +1424,7 @@ function test(options = {}) {
|
|
|
1423
1424
|
files: GLOB_TESTS,
|
|
1424
1425
|
name: "antfu:test:rules",
|
|
1425
1426
|
rules: {
|
|
1427
|
+
"node/prefer-global/process": "off",
|
|
1426
1428
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1427
1429
|
"test/no-identical-title": "error",
|
|
1428
1430
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,10 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
|
2
2
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
3
|
import * as parser from '@typescript-eslint/parser';
|
|
4
4
|
export { parser as parserTs };
|
|
5
|
-
import { MergeIntersection, RenamePrefix,
|
|
5
|
+
import { RuleConfig, MergeIntersection, RenamePrefix, VitestRules, YmlRules, NRules, Prefix, ImportRules, EslintRules, JsoncRules, VueRules, EslintCommentsRules, FlatESLintConfigItem } from '@antfu/eslint-define-config';
|
|
6
|
+
import { RuleOptions as RuleOptions$1 } from '@eslint-types/jsdoc/types';
|
|
7
|
+
import { RuleOptions } from '@eslint-types/typescript-eslint/types';
|
|
8
|
+
import { RuleOptions as RuleOptions$2 } from '@eslint-types/unicorn/types';
|
|
6
9
|
import { Rules as Rules$1 } from 'eslint-plugin-antfu';
|
|
7
10
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
8
11
|
import { UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
|
|
@@ -28,13 +31,14 @@ export { default as parserVue } from 'vue-eslint-parser';
|
|
|
28
31
|
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
29
32
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
30
33
|
|
|
31
|
-
type
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
type WrapRuleConfig<T extends {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}> = {
|
|
37
|
+
[K in keyof T]: T[K] extends RuleConfig ? T[K] : RuleConfig<T[K]>;
|
|
38
|
+
};
|
|
39
|
+
type Rules = WrapRuleConfig<MergeIntersection<RenamePrefix<RuleOptions, '@typescript-eslint/', 'ts/'> & RenamePrefix<VitestRules, 'vitest/', 'test/'> & RenamePrefix<YmlRules, 'yml/', 'yaml/'> & RenamePrefix<NRules, 'n/', 'node/'> & Prefix<UnprefixedRuleOptions, 'style/'> & Prefix<Rules$1, 'antfu/'> & RuleOptions$1 & ImportRules & EslintRules & JsoncRules & VueRules & RuleOptions$2 & EslintCommentsRules & {
|
|
36
40
|
'test/no-only-tests': RuleConfig<[]>;
|
|
37
|
-
}
|
|
41
|
+
}>>;
|
|
38
42
|
type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, 'plugins'> & {
|
|
39
43
|
/**
|
|
40
44
|
* Custom name of each config item
|
|
@@ -251,4 +255,4 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
251
255
|
};
|
|
252
256
|
declare function toArray<T>(value: T | T[]): T[];
|
|
253
257
|
|
|
254
|
-
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, antfu, combine, comments, antfu as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, vue, yaml };
|
|
258
|
+
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, WrapRuleConfig, antfu, combine, comments, antfu as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, vue, yaml };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
|
2
2
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
3
3
|
import * as parser from '@typescript-eslint/parser';
|
|
4
4
|
export { parser as parserTs };
|
|
5
|
-
import { MergeIntersection, RenamePrefix,
|
|
5
|
+
import { RuleConfig, MergeIntersection, RenamePrefix, VitestRules, YmlRules, NRules, Prefix, ImportRules, EslintRules, JsoncRules, VueRules, EslintCommentsRules, FlatESLintConfigItem } from '@antfu/eslint-define-config';
|
|
6
|
+
import { RuleOptions as RuleOptions$1 } from '@eslint-types/jsdoc/types';
|
|
7
|
+
import { RuleOptions } from '@eslint-types/typescript-eslint/types';
|
|
8
|
+
import { RuleOptions as RuleOptions$2 } from '@eslint-types/unicorn/types';
|
|
6
9
|
import { Rules as Rules$1 } from 'eslint-plugin-antfu';
|
|
7
10
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
8
11
|
import { UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
|
|
@@ -28,13 +31,14 @@ export { default as parserVue } from 'vue-eslint-parser';
|
|
|
28
31
|
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
29
32
|
export { default as parserJsonc } from 'jsonc-eslint-parser';
|
|
30
33
|
|
|
31
|
-
type
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
type WrapRuleConfig<T extends {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}> = {
|
|
37
|
+
[K in keyof T]: T[K] extends RuleConfig ? T[K] : RuleConfig<T[K]>;
|
|
38
|
+
};
|
|
39
|
+
type Rules = WrapRuleConfig<MergeIntersection<RenamePrefix<RuleOptions, '@typescript-eslint/', 'ts/'> & RenamePrefix<VitestRules, 'vitest/', 'test/'> & RenamePrefix<YmlRules, 'yml/', 'yaml/'> & RenamePrefix<NRules, 'n/', 'node/'> & Prefix<UnprefixedRuleOptions, 'style/'> & Prefix<Rules$1, 'antfu/'> & RuleOptions$1 & ImportRules & EslintRules & JsoncRules & VueRules & RuleOptions$2 & EslintCommentsRules & {
|
|
36
40
|
'test/no-only-tests': RuleConfig<[]>;
|
|
37
|
-
}
|
|
41
|
+
}>>;
|
|
38
42
|
type ConfigItem = Omit<FlatESLintConfigItem<Rules, false>, 'plugins'> & {
|
|
39
43
|
/**
|
|
40
44
|
* Custom name of each config item
|
|
@@ -251,4 +255,4 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
251
255
|
};
|
|
252
256
|
declare function toArray<T>(value: T | T[]): T[];
|
|
253
257
|
|
|
254
|
-
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, antfu, combine, comments, antfu as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, vue, yaml };
|
|
258
|
+
export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, Rules, StylisticConfig, WrapRuleConfig, antfu, combine, comments, antfu as default, ignores, imports, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -499,13 +499,15 @@ function markdown(options = {}) {
|
|
|
499
499
|
},
|
|
500
500
|
name: "antfu:markdown:rules",
|
|
501
501
|
rules: {
|
|
502
|
-
"antfu/no-cjs-exports": "off",
|
|
503
502
|
"antfu/no-ts-export-equal": "off",
|
|
504
503
|
"import/newline-after-import": "off",
|
|
505
504
|
"no-alert": "off",
|
|
506
505
|
"no-console": "off",
|
|
506
|
+
"no-labels": "off",
|
|
507
|
+
"no-restricted-syntax": "off",
|
|
507
508
|
"no-undef": "off",
|
|
508
509
|
"no-unused-expressions": "off",
|
|
510
|
+
"no-unused-labels": "off",
|
|
509
511
|
"no-unused-vars": "off",
|
|
510
512
|
"node/prefer-global/process": "off",
|
|
511
513
|
"style/comma-dangle": "off",
|
|
@@ -1033,7 +1035,6 @@ function typescript(options) {
|
|
|
1033
1035
|
),
|
|
1034
1036
|
"antfu/generic-spacing": "error",
|
|
1035
1037
|
"antfu/named-tuple-spacing": "error",
|
|
1036
|
-
"antfu/no-cjs-exports": "error",
|
|
1037
1038
|
"no-dupe-class-members": "off",
|
|
1038
1039
|
"no-invalid-this": "off",
|
|
1039
1040
|
"no-loss-of-precision": "off",
|
|
@@ -1325,6 +1326,7 @@ function test(options = {}) {
|
|
|
1325
1326
|
files: GLOB_TESTS,
|
|
1326
1327
|
name: "antfu:test:rules",
|
|
1327
1328
|
rules: {
|
|
1329
|
+
"node/prefer-global/process": "off",
|
|
1328
1330
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1329
1331
|
"test/no-identical-title": "error",
|
|
1330
1332
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
5
|
-
"packageManager": "pnpm@8.10.
|
|
4
|
+
"version": "1.1.2",
|
|
5
|
+
"packageManager": "pnpm@8.10.4",
|
|
6
6
|
"description": "Anthony's ESLint config",
|
|
7
7
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@antfu/eslint-define-config": "^1.23.0-2",
|
|
32
|
-
"@
|
|
32
|
+
"@eslint-types/jsdoc": "46.8.2-1",
|
|
33
|
+
"@eslint-types/typescript-eslint": "^6.9.1",
|
|
34
|
+
"@eslint-types/unicorn": "^49.0.0",
|
|
35
|
+
"@stylistic/eslint-plugin": "^1.2.0",
|
|
33
36
|
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
34
37
|
"@typescript-eslint/parser": "^6.10.0",
|
|
35
38
|
"eslint-config-flat-gitignore": "^0.1.1",
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
"eslint-plugin-markdown": "^3.0.1",
|
|
42
45
|
"eslint-plugin-n": "^16.3.1",
|
|
43
46
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
44
|
-
"eslint-plugin-perfectionist": "^2.
|
|
47
|
+
"eslint-plugin-perfectionist": "^2.3.0",
|
|
45
48
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
46
49
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
47
50
|
"eslint-plugin-vitest": "^0.3.9",
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
},
|
|
61
64
|
"devDependencies": {
|
|
62
65
|
"@antfu/ni": "^0.21.9",
|
|
63
|
-
"@stylistic/eslint-plugin-migrate": "^1.
|
|
66
|
+
"@stylistic/eslint-plugin-migrate": "^1.2.0",
|
|
64
67
|
"@types/eslint": "^8.44.7",
|
|
65
68
|
"@types/fs-extra": "^11.0.4",
|
|
66
69
|
"@types/node": "^20.9.0",
|
|
@@ -72,13 +75,13 @@
|
|
|
72
75
|
"esno": "^4.0.0",
|
|
73
76
|
"fast-glob": "^3.3.2",
|
|
74
77
|
"fs-extra": "^11.1.1",
|
|
75
|
-
"lint-staged": "^15.0
|
|
78
|
+
"lint-staged": "^15.1.0",
|
|
76
79
|
"rimraf": "^5.0.5",
|
|
77
80
|
"simple-git-hooks": "^2.9.0",
|
|
78
81
|
"tsup": "^7.2.0",
|
|
79
82
|
"typescript": "^5.2.2",
|
|
80
83
|
"vitest": "^0.34.6",
|
|
81
|
-
"@antfu/eslint-config": "1.1.
|
|
84
|
+
"@antfu/eslint-config": "1.1.2"
|
|
82
85
|
},
|
|
83
86
|
"simple-git-hooks": {
|
|
84
87
|
"pre-commit": "pnpm lint-staged"
|