@antfu/eslint-config 2.4.5 → 2.4.6

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,13 +46,13 @@ 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 = "2.4.5";
49
+ var version = "2.4.6";
50
50
  var devDependencies = {
51
51
  "@antfu/eslint-config": "workspace:*",
52
52
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
53
53
  "@antfu/ni": "^0.21.12",
54
54
  "@stylistic/eslint-plugin-migrate": "^1.5.1",
55
- "@types/eslint": "^8.44.8",
55
+ "@types/eslint": "^8.44.9",
56
56
  "@types/fs-extra": "^11.0.4",
57
57
  "@types/node": "^20.10.4",
58
58
  "@types/prompts": "^2.4.9",
package/dist/cli.js CHANGED
@@ -17,13 +17,13 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.4.5";
20
+ var version = "2.4.6";
21
21
  var devDependencies = {
22
22
  "@antfu/eslint-config": "workspace:*",
23
23
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
24
24
  "@antfu/ni": "^0.21.12",
25
25
  "@stylistic/eslint-plugin-migrate": "^1.5.1",
26
- "@types/eslint": "^8.44.8",
26
+ "@types/eslint": "^8.44.9",
27
27
  "@types/fs-extra": "^11.0.4",
28
28
  "@types/node": "^20.10.4",
29
29
  "@types/prompts": "^2.4.9",
package/dist/index.cjs CHANGED
@@ -69,6 +69,7 @@ __export(src_exports, {
69
69
  jsonc: () => jsonc,
70
70
  markdown: () => markdown,
71
71
  node: () => node,
72
+ parserPlain: () => parserPlain,
72
73
  perfectionist: () => perfectionist,
73
74
  react: () => react,
74
75
  renameRules: () => renameRules,
@@ -447,6 +448,26 @@ async function javascript(options = {}) {
447
448
  // src/utils.ts
448
449
  var import_node_process = __toESM(require("process"), 1);
449
450
  var import_local_pkg = require("local-pkg");
451
+ var parserPlain = {
452
+ meta: {
453
+ name: "parser-plain"
454
+ },
455
+ parseForESLint: (code) => ({
456
+ ast: {
457
+ body: [],
458
+ comments: [],
459
+ loc: { end: code.length, start: 0 },
460
+ range: [0, code.length],
461
+ tokens: [],
462
+ type: "Program"
463
+ },
464
+ scopeManager: null,
465
+ services: { isPlain: true },
466
+ visitorKeys: {
467
+ Program: []
468
+ }
469
+ })
470
+ };
450
471
  async function combine(...configs) {
451
472
  const resolved = await Promise.all(configs);
452
473
  return resolved.flat();
@@ -598,7 +619,6 @@ async function jsonc(options = {}) {
598
619
  }
599
620
 
600
621
  // src/configs/markdown.ts
601
- var parserPlain = __toESM(require("eslint-parser-plain"), 1);
602
622
  var import_eslint_merge_processors = require("eslint-merge-processors");
603
623
  async function markdown(options = {}) {
604
624
  const {
@@ -729,9 +749,6 @@ async function perfectionist() {
729
749
  ];
730
750
  }
731
751
 
732
- // src/configs/formatters.ts
733
- var parserPlain2 = __toESM(require("eslint-parser-plain"), 1);
734
-
735
752
  // src/configs/stylistic.ts
736
753
  var StylisticConfigDefaults = {
737
754
  indent: 2,
@@ -830,7 +847,7 @@ async function formatters(options = {}, stylistic2 = {}) {
830
847
  {
831
848
  files: [GLOB_CSS, GLOB_POSTCSS],
832
849
  languageOptions: {
833
- parser: parserPlain2
850
+ parser: parserPlain
834
851
  },
835
852
  name: "antfu:formatter:css",
836
853
  rules: {
@@ -846,7 +863,7 @@ async function formatters(options = {}, stylistic2 = {}) {
846
863
  {
847
864
  files: [GLOB_SCSS],
848
865
  languageOptions: {
849
- parser: parserPlain2
866
+ parser: parserPlain
850
867
  },
851
868
  name: "antfu:formatter:scss",
852
869
  rules: {
@@ -862,7 +879,7 @@ async function formatters(options = {}, stylistic2 = {}) {
862
879
  {
863
880
  files: [GLOB_LESS],
864
881
  languageOptions: {
865
- parser: parserPlain2
882
+ parser: parserPlain
866
883
  },
867
884
  name: "antfu:formatter:less",
868
885
  rules: {
@@ -881,7 +898,7 @@ async function formatters(options = {}, stylistic2 = {}) {
881
898
  configs.push({
882
899
  files: ["**/*.html"],
883
900
  languageOptions: {
884
- parser: parserPlain2
901
+ parser: parserPlain
885
902
  },
886
903
  name: "antfu:formatter:html",
887
904
  rules: {
@@ -900,7 +917,7 @@ async function formatters(options = {}, stylistic2 = {}) {
900
917
  configs.push({
901
918
  files: [GLOB_MARKDOWN],
902
919
  languageOptions: {
903
- parser: parserPlain2
920
+ parser: parserPlain
904
921
  },
905
922
  name: "antfu:formatter:markdown",
906
923
  rules: {
@@ -922,7 +939,7 @@ async function formatters(options = {}, stylistic2 = {}) {
922
939
  configs.push({
923
940
  files: ["**/*.graphql"],
924
941
  languageOptions: {
925
- parser: parserPlain2
942
+ parser: parserPlain
926
943
  },
927
944
  name: "antfu:formatter:graphql",
928
945
  rules: {
@@ -1100,15 +1117,11 @@ async function sortPackageJson() {
1100
1117
  },
1101
1118
  {
1102
1119
  order: { type: "asc" },
1103
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
1104
- },
1105
- {
1106
- order: { type: "asc" },
1107
- pathPattern: "^resolutions$"
1120
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1108
1121
  },
1109
1122
  {
1110
1123
  order: { type: "asc" },
1111
- pathPattern: "^pnpm.overrides$"
1124
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1112
1125
  },
1113
1126
  {
1114
1127
  order: [
@@ -1954,6 +1967,7 @@ var src_default = antfu;
1954
1967
  jsonc,
1955
1968
  markdown,
1956
1969
  node,
1970
+ parserPlain,
1957
1971
  perfectionist,
1958
1972
  react,
1959
1973
  renameRules,
package/dist/index.d.cts CHANGED
@@ -441,6 +441,31 @@ declare const GLOB_TESTS: string[];
441
441
  declare const GLOB_ALL_SRC: string[];
442
442
  declare const GLOB_EXCLUDE: string[];
443
443
 
444
+ declare const parserPlain: {
445
+ meta: {
446
+ name: string;
447
+ };
448
+ parseForESLint: (code: string) => {
449
+ ast: {
450
+ body: never[];
451
+ comments: never[];
452
+ loc: {
453
+ end: number;
454
+ start: number;
455
+ };
456
+ range: number[];
457
+ tokens: never[];
458
+ type: string;
459
+ };
460
+ scopeManager: null;
461
+ services: {
462
+ isPlain: boolean;
463
+ };
464
+ visitorKeys: {
465
+ Program: never[];
466
+ };
467
+ };
468
+ };
444
469
  /**
445
470
  * Combine array and non-array configs into a single array.
446
471
  */
@@ -454,4 +479,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
454
479
  } ? U : T>;
455
480
  declare function ensurePackages(packages: string[]): Promise<void>;
456
481
 
457
- export { type Awaitable, type FlatConfigItem, 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_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, antfu, combine, comments, antfu as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
482
+ export { type Awaitable, type FlatConfigItem, 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_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, antfu, combine, comments, antfu as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.d.ts CHANGED
@@ -441,6 +441,31 @@ declare const GLOB_TESTS: string[];
441
441
  declare const GLOB_ALL_SRC: string[];
442
442
  declare const GLOB_EXCLUDE: string[];
443
443
 
444
+ declare const parserPlain: {
445
+ meta: {
446
+ name: string;
447
+ };
448
+ parseForESLint: (code: string) => {
449
+ ast: {
450
+ body: never[];
451
+ comments: never[];
452
+ loc: {
453
+ end: number;
454
+ start: number;
455
+ };
456
+ range: number[];
457
+ tokens: never[];
458
+ type: string;
459
+ };
460
+ scopeManager: null;
461
+ services: {
462
+ isPlain: boolean;
463
+ };
464
+ visitorKeys: {
465
+ Program: never[];
466
+ };
467
+ };
468
+ };
444
469
  /**
445
470
  * Combine array and non-array configs into a single array.
446
471
  */
@@ -454,4 +479,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
454
479
  } ? U : T>;
455
480
  declare function ensurePackages(packages: string[]): Promise<void>;
456
481
 
457
- export { type Awaitable, type FlatConfigItem, 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_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, antfu, combine, comments, antfu as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
482
+ export { type Awaitable, type FlatConfigItem, 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_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type OptionsVue, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, antfu, combine, comments, antfu as default, ensurePackages, formatters, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, react, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -359,6 +359,26 @@ async function javascript(options = {}) {
359
359
  // src/utils.ts
360
360
  import process from "process";
361
361
  import { isPackageExists } from "local-pkg";
362
+ var parserPlain = {
363
+ meta: {
364
+ name: "parser-plain"
365
+ },
366
+ parseForESLint: (code) => ({
367
+ ast: {
368
+ body: [],
369
+ comments: [],
370
+ loc: { end: code.length, start: 0 },
371
+ range: [0, code.length],
372
+ tokens: [],
373
+ type: "Program"
374
+ },
375
+ scopeManager: null,
376
+ services: { isPlain: true },
377
+ visitorKeys: {
378
+ Program: []
379
+ }
380
+ })
381
+ };
362
382
  async function combine(...configs) {
363
383
  const resolved = await Promise.all(configs);
364
384
  return resolved.flat();
@@ -510,7 +530,6 @@ async function jsonc(options = {}) {
510
530
  }
511
531
 
512
532
  // src/configs/markdown.ts
513
- import * as parserPlain from "eslint-parser-plain";
514
533
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
515
534
  async function markdown(options = {}) {
516
535
  const {
@@ -641,9 +660,6 @@ async function perfectionist() {
641
660
  ];
642
661
  }
643
662
 
644
- // src/configs/formatters.ts
645
- import * as parserPlain2 from "eslint-parser-plain";
646
-
647
663
  // src/configs/stylistic.ts
648
664
  var StylisticConfigDefaults = {
649
665
  indent: 2,
@@ -742,7 +758,7 @@ async function formatters(options = {}, stylistic2 = {}) {
742
758
  {
743
759
  files: [GLOB_CSS, GLOB_POSTCSS],
744
760
  languageOptions: {
745
- parser: parserPlain2
761
+ parser: parserPlain
746
762
  },
747
763
  name: "antfu:formatter:css",
748
764
  rules: {
@@ -758,7 +774,7 @@ async function formatters(options = {}, stylistic2 = {}) {
758
774
  {
759
775
  files: [GLOB_SCSS],
760
776
  languageOptions: {
761
- parser: parserPlain2
777
+ parser: parserPlain
762
778
  },
763
779
  name: "antfu:formatter:scss",
764
780
  rules: {
@@ -774,7 +790,7 @@ async function formatters(options = {}, stylistic2 = {}) {
774
790
  {
775
791
  files: [GLOB_LESS],
776
792
  languageOptions: {
777
- parser: parserPlain2
793
+ parser: parserPlain
778
794
  },
779
795
  name: "antfu:formatter:less",
780
796
  rules: {
@@ -793,7 +809,7 @@ async function formatters(options = {}, stylistic2 = {}) {
793
809
  configs.push({
794
810
  files: ["**/*.html"],
795
811
  languageOptions: {
796
- parser: parserPlain2
812
+ parser: parserPlain
797
813
  },
798
814
  name: "antfu:formatter:html",
799
815
  rules: {
@@ -812,7 +828,7 @@ async function formatters(options = {}, stylistic2 = {}) {
812
828
  configs.push({
813
829
  files: [GLOB_MARKDOWN],
814
830
  languageOptions: {
815
- parser: parserPlain2
831
+ parser: parserPlain
816
832
  },
817
833
  name: "antfu:formatter:markdown",
818
834
  rules: {
@@ -834,7 +850,7 @@ async function formatters(options = {}, stylistic2 = {}) {
834
850
  configs.push({
835
851
  files: ["**/*.graphql"],
836
852
  languageOptions: {
837
- parser: parserPlain2
853
+ parser: parserPlain
838
854
  },
839
855
  name: "antfu:formatter:graphql",
840
856
  rules: {
@@ -1012,15 +1028,11 @@ async function sortPackageJson() {
1012
1028
  },
1013
1029
  {
1014
1030
  order: { type: "asc" },
1015
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
1016
- },
1017
- {
1018
- order: { type: "asc" },
1019
- pathPattern: "^resolutions$"
1031
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
1020
1032
  },
1021
1033
  {
1022
1034
  order: { type: "asc" },
1023
- pathPattern: "^pnpm.overrides$"
1035
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1024
1036
  },
1025
1037
  {
1026
1038
  order: [
@@ -1866,6 +1878,7 @@ export {
1866
1878
  jsonc,
1867
1879
  markdown,
1868
1880
  node,
1881
+ parserPlain,
1869
1882
  perfectionist,
1870
1883
  react,
1871
1884
  renameRules,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "2.4.5",
5
- "packageManager": "pnpm@8.12.0",
4
+ "version": "2.4.6",
5
+ "packageManager": "pnpm@8.12.1",
6
6
  "description": "Anthony's ESLint config",
7
7
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
8
8
  "license": "MIT",
@@ -33,10 +33,10 @@
33
33
  "eslint-plugin-react-refresh": "^0.4.4"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
- "eslint-plugin-format": {
36
+ "@unocss/eslint-plugin": {
37
37
  "optional": true
38
38
  },
39
- "@unocss/eslint-plugin": {
39
+ "eslint-plugin-format": {
40
40
  "optional": true
41
41
  },
42
42
  "eslint-plugin-react": {
@@ -56,26 +56,25 @@
56
56
  "@eslint-types/typescript-eslint": "^6.12.0",
57
57
  "@eslint-types/unicorn": "^49.0.0",
58
58
  "@stylistic/eslint-plugin": "^1.5.1",
59
- "@typescript-eslint/eslint-plugin": "^6.13.2",
60
- "@typescript-eslint/parser": "^6.13.2",
59
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
60
+ "@typescript-eslint/parser": "^6.14.0",
61
61
  "eslint-config-flat-gitignore": "^0.1.2",
62
62
  "eslint-merge-processors": "^0.1.0",
63
- "eslint-parser-plain": "^0.1.0",
64
63
  "eslint-plugin-antfu": "^2.0.0",
65
64
  "eslint-plugin-eslint-comments": "^3.2.0",
66
65
  "eslint-plugin-i": "^2.29.0",
67
- "eslint-plugin-jsdoc": "^46.9.0",
68
- "eslint-plugin-jsonc": "^2.10.0",
66
+ "eslint-plugin-jsdoc": "^46.9.1",
67
+ "eslint-plugin-jsonc": "^2.11.1",
69
68
  "eslint-plugin-markdown": "^3.0.1",
70
69
  "eslint-plugin-n": "^16.4.0",
71
70
  "eslint-plugin-no-only-tests": "^3.1.0",
72
71
  "eslint-plugin-perfectionist": "^2.5.0",
73
- "eslint-plugin-toml": "^0.7.1",
72
+ "eslint-plugin-toml": "^0.8.0",
74
73
  "eslint-plugin-unicorn": "^49.0.0",
75
74
  "eslint-plugin-unused-imports": "^3.0.0",
76
- "eslint-plugin-vitest": "^0.3.15",
75
+ "eslint-plugin-vitest": "^0.3.17",
77
76
  "eslint-plugin-vue": "^9.19.2",
78
- "eslint-plugin-yml": "^1.10.0",
77
+ "eslint-plugin-yml": "^1.11.0",
79
78
  "eslint-processor-vue-blocks": "^0.1.1",
80
79
  "globals": "^13.24.0",
81
80
  "jsonc-eslint-parser": "^2.4.0",
@@ -92,7 +91,7 @@
92
91
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
93
92
  "@antfu/ni": "^0.21.12",
94
93
  "@stylistic/eslint-plugin-migrate": "^1.5.1",
95
- "@types/eslint": "^8.44.8",
94
+ "@types/eslint": "^8.44.9",
96
95
  "@types/fs-extra": "^11.0.4",
97
96
  "@types/node": "^20.10.4",
98
97
  "@types/prompts": "^2.4.9",
@@ -117,7 +116,7 @@
117
116
  "typescript": "^5.3.3",
118
117
  "vitest": "^1.0.4",
119
118
  "vue": "^3.3.11",
120
- "@antfu/eslint-config": "2.4.5"
119
+ "@antfu/eslint-config": "2.4.6"
121
120
  },
122
121
  "simple-git-hooks": {
123
122
  "pre-commit": "pnpm lint-staged"