@antfu/eslint-config 1.1.1 → 1.1.3

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 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.1";
49
+ var version = "1.1.3";
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(` ow you can update the dependencies and run ${import_picocolors2.default.blue("eslint . --fix")}
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.1";
20
+ var version = "1.1.3";
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(` ow you can update the dependencies and run ${c2.blue("eslint . --fix")}
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
@@ -188,6 +188,10 @@ var GLOB_EXCLUDE = [
188
188
  "**/output",
189
189
  "**/coverage",
190
190
  "**/temp",
191
+ "**/.temp",
192
+ "**/tmp",
193
+ "**/.tmp",
194
+ "**/.history",
191
195
  "**/.vitepress/cache",
192
196
  "**/.nuxt",
193
197
  "**/.next",
@@ -597,13 +601,16 @@ function markdown(options = {}) {
597
601
  },
598
602
  name: "antfu:markdown:rules",
599
603
  rules: {
600
- "antfu/no-cjs-exports": "off",
601
604
  "antfu/no-ts-export-equal": "off",
602
605
  "import/newline-after-import": "off",
603
606
  "no-alert": "off",
604
607
  "no-console": "off",
608
+ "no-labels": "off",
609
+ "no-lone-blocks": "off",
610
+ "no-restricted-syntax": "off",
605
611
  "no-undef": "off",
606
612
  "no-unused-expressions": "off",
613
+ "no-unused-labels": "off",
607
614
  "no-unused-vars": "off",
608
615
  "node/prefer-global/process": "off",
609
616
  "style/comma-dangle": "off",
@@ -898,6 +905,7 @@ function stylistic(options = {}) {
898
905
  rules: {
899
906
  "antfu/consistent-list-newline": "error",
900
907
  "antfu/if-newline": "error",
908
+ "antfu/indent-binary-ops": ["error", { indent }],
901
909
  "antfu/top-level-function": "error",
902
910
  "curly": ["error", "multi-or-nest", "consistent"],
903
911
  "style/array-bracket-spacing": ["error", "never"],
@@ -1131,7 +1139,6 @@ function typescript(options) {
1131
1139
  ),
1132
1140
  "antfu/generic-spacing": "error",
1133
1141
  "antfu/named-tuple-spacing": "error",
1134
- "antfu/no-cjs-exports": "error",
1135
1142
  "no-dupe-class-members": "off",
1136
1143
  "no-invalid-this": "off",
1137
1144
  "no-loss-of-precision": "off",
@@ -1423,6 +1430,7 @@ function test(options = {}) {
1423
1430
  files: GLOB_TESTS,
1424
1431
  name: "antfu:test:rules",
1425
1432
  rules: {
1433
+ "node/prefer-global/process": "off",
1426
1434
  "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1427
1435
  "test/no-identical-title": "error",
1428
1436
  "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, TypeScriptRules, VitestRules, YmlRules, NRules, Prefix, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem, Unprefix, ReactRules } from '@antfu/eslint-define-config';
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 StylisticMergedRules = MergeIntersection<EslintRules & Unprefix<ReactRules, 'react/'> & Unprefix<TypeScriptRules, '@typescript-eslint/'> & {
32
- 'jsx-self-closing-comp': ReactRules['react/self-closing-comp'];
33
- }>;
34
- type StylisticRules = Pick<StylisticMergedRules, keyof UnprefixedRuleOptions>;
35
- type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, '@typescript-eslint/', 'ts/'> & RenamePrefix<VitestRules, 'vitest/', 'test/'> & RenamePrefix<YmlRules, 'yml/', 'yaml/'> & RenamePrefix<NRules, 'n/', 'node/'> & Prefix<StylisticRules, 'style/'> & Prefix<Rules$1, 'antfu/'> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
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, TypeScriptRules, VitestRules, YmlRules, NRules, Prefix, ImportRules, EslintRules, JsoncRules, VueRules, UnicornRules, EslintCommentsRules, RuleConfig, FlatESLintConfigItem, Unprefix, ReactRules } from '@antfu/eslint-define-config';
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 StylisticMergedRules = MergeIntersection<EslintRules & Unprefix<ReactRules, 'react/'> & Unprefix<TypeScriptRules, '@typescript-eslint/'> & {
32
- 'jsx-self-closing-comp': ReactRules['react/self-closing-comp'];
33
- }>;
34
- type StylisticRules = Pick<StylisticMergedRules, keyof UnprefixedRuleOptions>;
35
- type Rules = MergeIntersection<RenamePrefix<TypeScriptRules, '@typescript-eslint/', 'ts/'> & RenamePrefix<VitestRules, 'vitest/', 'test/'> & RenamePrefix<YmlRules, 'yml/', 'yaml/'> & RenamePrefix<NRules, 'n/', 'node/'> & Prefix<StylisticRules, 'style/'> & Prefix<Rules$1, 'antfu/'> & ImportRules & EslintRules & JsoncRules & VueRules & UnicornRules & EslintCommentsRules & {
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
@@ -90,6 +90,10 @@ var GLOB_EXCLUDE = [
90
90
  "**/output",
91
91
  "**/coverage",
92
92
  "**/temp",
93
+ "**/.temp",
94
+ "**/tmp",
95
+ "**/.tmp",
96
+ "**/.history",
93
97
  "**/.vitepress/cache",
94
98
  "**/.nuxt",
95
99
  "**/.next",
@@ -499,13 +503,16 @@ function markdown(options = {}) {
499
503
  },
500
504
  name: "antfu:markdown:rules",
501
505
  rules: {
502
- "antfu/no-cjs-exports": "off",
503
506
  "antfu/no-ts-export-equal": "off",
504
507
  "import/newline-after-import": "off",
505
508
  "no-alert": "off",
506
509
  "no-console": "off",
510
+ "no-labels": "off",
511
+ "no-lone-blocks": "off",
512
+ "no-restricted-syntax": "off",
507
513
  "no-undef": "off",
508
514
  "no-unused-expressions": "off",
515
+ "no-unused-labels": "off",
509
516
  "no-unused-vars": "off",
510
517
  "node/prefer-global/process": "off",
511
518
  "style/comma-dangle": "off",
@@ -800,6 +807,7 @@ function stylistic(options = {}) {
800
807
  rules: {
801
808
  "antfu/consistent-list-newline": "error",
802
809
  "antfu/if-newline": "error",
810
+ "antfu/indent-binary-ops": ["error", { indent }],
803
811
  "antfu/top-level-function": "error",
804
812
  "curly": ["error", "multi-or-nest", "consistent"],
805
813
  "style/array-bracket-spacing": ["error", "never"],
@@ -1033,7 +1041,6 @@ function typescript(options) {
1033
1041
  ),
1034
1042
  "antfu/generic-spacing": "error",
1035
1043
  "antfu/named-tuple-spacing": "error",
1036
- "antfu/no-cjs-exports": "error",
1037
1044
  "no-dupe-class-members": "off",
1038
1045
  "no-invalid-this": "off",
1039
1046
  "no-loss-of-precision": "off",
@@ -1325,6 +1332,7 @@ function test(options = {}) {
1325
1332
  files: GLOB_TESTS,
1326
1333
  name: "antfu:test:rules",
1327
1334
  rules: {
1335
+ "node/prefer-global/process": "off",
1328
1336
  "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1329
1337
  "test/no-identical-title": "error",
1330
1338
  "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.1",
5
- "packageManager": "pnpm@8.10.2",
4
+ "version": "1.1.3",
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,11 +29,14 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@antfu/eslint-define-config": "^1.23.0-2",
32
- "@stylistic/eslint-plugin": "^1.1.0",
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",
36
- "eslint-plugin-antfu": "^1.0.2",
39
+ "eslint-plugin-antfu": "^1.0.6",
37
40
  "eslint-plugin-eslint-comments": "^3.2.0",
38
41
  "eslint-plugin-i": "^2.29.0",
39
42
  "eslint-plugin-jsdoc": "^46.9.0",
@@ -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.2.0",
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.1.0",
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.2",
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.1"
84
+ "@antfu/eslint-config": "1.1.3"
82
85
  },
83
86
  "simple-git-hooks": {
84
87
  "pre-commit": "pnpm lint-staged"