@antfu/eslint-config 2.3.2 → 2.3.4

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,12 +46,12 @@ 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.3.2";
49
+ var version = "2.3.4";
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
- "@stylistic/eslint-plugin-migrate": "^1.4.1",
54
+ "@stylistic/eslint-plugin-migrate": "^1.5.0",
55
55
  "@types/eslint": "^8.44.8",
56
56
  "@types/fs-extra": "^11.0.4",
57
57
  "@types/node": "^20.10.3",
@@ -61,7 +61,7 @@ var devDependencies = {
61
61
  bumpp: "^9.2.0",
62
62
  eslint: "^8.55.0",
63
63
  "eslint-flat-config-viewer": "^0.1.3",
64
- "eslint-plugin-format": "^0.0.1",
64
+ "eslint-plugin-format": "^0.1.0",
65
65
  "eslint-plugin-react": "^7.33.2",
66
66
  "eslint-plugin-react-hooks": "^4.6.0",
67
67
  "eslint-plugin-react-refresh": "^0.4.5",
package/dist/cli.js CHANGED
@@ -17,12 +17,12 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.3.2";
20
+ var version = "2.3.4";
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
- "@stylistic/eslint-plugin-migrate": "^1.4.1",
25
+ "@stylistic/eslint-plugin-migrate": "^1.5.0",
26
26
  "@types/eslint": "^8.44.8",
27
27
  "@types/fs-extra": "^11.0.4",
28
28
  "@types/node": "^20.10.3",
@@ -32,7 +32,7 @@ var devDependencies = {
32
32
  bumpp: "^9.2.0",
33
33
  eslint: "^8.55.0",
34
34
  "eslint-flat-config-viewer": "^0.1.3",
35
- "eslint-plugin-format": "^0.0.1",
35
+ "eslint-plugin-format": "^0.1.0",
36
36
  "eslint-plugin-react": "^7.33.2",
37
37
  "eslint-plugin-react-hooks": "^4.6.0",
38
38
  "eslint-plugin-react-refresh": "^0.4.5",
package/dist/index.cjs CHANGED
@@ -787,7 +787,7 @@ async function stylistic(options = {}) {
787
787
  }
788
788
 
789
789
  // src/configs/formatters.ts
790
- async function formatters(options = {}, stylistic2 = {}) {
790
+ async function formatters(options = {}, stylistic2 = {}, markdownEnabled = true) {
791
791
  await ensurePackages([
792
792
  "eslint-plugin-format"
793
793
  ]);
@@ -926,7 +926,7 @@ async function formatters(options = {}, stylistic2 = {}) {
926
926
  if (options.markdown) {
927
927
  const formater = options.markdown === true ? "prettier" : options.markdown;
928
928
  configs.push({
929
- files: ["**/*.__markdown_content__"],
929
+ files: markdownEnabled ? ["**/*.__markdown_content__"] : [GLOB_MARKDOWN],
930
930
  languageOptions: {
931
931
  parser: pluginFormat.parserPlain
932
932
  },
@@ -1837,7 +1837,8 @@ async function antfu(options = {}, ...userConfigs) {
1837
1837
  if (options.formatters) {
1838
1838
  configs.push(formatters(
1839
1839
  options.formatters,
1840
- typeof stylisticOptions === "boolean" ? {} : stylisticOptions
1840
+ typeof stylisticOptions === "boolean" ? {} : stylisticOptions,
1841
+ options.markdown !== false
1841
1842
  ));
1842
1843
  }
1843
1844
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
package/dist/index.d.cts CHANGED
@@ -273,7 +273,9 @@ interface OptionsConfig extends OptionsComponentExts {
273
273
  */
274
274
  yaml?: boolean;
275
275
  /**
276
- * Enable Markdown support.
276
+ * Enable linting for **code snippets** in Markdown.
277
+ *
278
+ * For formatting Markdown content, enable also `formatters.markdown`.
277
279
  *
278
280
  * @default true
279
281
  */
@@ -363,7 +365,7 @@ declare function node(): Promise<FlatConfigItem[]>;
363
365
  */
364
366
  declare function perfectionist(): Promise<FlatConfigItem[]>;
365
367
 
366
- declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<FlatConfigItem[]>;
368
+ declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig, markdownEnabled?: boolean): Promise<FlatConfigItem[]>;
367
369
 
368
370
  declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles): Promise<FlatConfigItem[]>;
369
371
 
package/dist/index.d.ts CHANGED
@@ -273,7 +273,9 @@ interface OptionsConfig extends OptionsComponentExts {
273
273
  */
274
274
  yaml?: boolean;
275
275
  /**
276
- * Enable Markdown support.
276
+ * Enable linting for **code snippets** in Markdown.
277
+ *
278
+ * For formatting Markdown content, enable also `formatters.markdown`.
277
279
  *
278
280
  * @default true
279
281
  */
@@ -363,7 +365,7 @@ declare function node(): Promise<FlatConfigItem[]>;
363
365
  */
364
366
  declare function perfectionist(): Promise<FlatConfigItem[]>;
365
367
 
366
- declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<FlatConfigItem[]>;
368
+ declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig, markdownEnabled?: boolean): Promise<FlatConfigItem[]>;
367
369
 
368
370
  declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles): Promise<FlatConfigItem[]>;
369
371
 
package/dist/index.js CHANGED
@@ -701,7 +701,7 @@ async function stylistic(options = {}) {
701
701
  }
702
702
 
703
703
  // src/configs/formatters.ts
704
- async function formatters(options = {}, stylistic2 = {}) {
704
+ async function formatters(options = {}, stylistic2 = {}, markdownEnabled = true) {
705
705
  await ensurePackages([
706
706
  "eslint-plugin-format"
707
707
  ]);
@@ -840,7 +840,7 @@ async function formatters(options = {}, stylistic2 = {}) {
840
840
  if (options.markdown) {
841
841
  const formater = options.markdown === true ? "prettier" : options.markdown;
842
842
  configs.push({
843
- files: ["**/*.__markdown_content__"],
843
+ files: markdownEnabled ? ["**/*.__markdown_content__"] : [GLOB_MARKDOWN],
844
844
  languageOptions: {
845
845
  parser: pluginFormat.parserPlain
846
846
  },
@@ -1751,7 +1751,8 @@ async function antfu(options = {}, ...userConfigs) {
1751
1751
  if (options.formatters) {
1752
1752
  configs.push(formatters(
1753
1753
  options.formatters,
1754
- typeof stylisticOptions === "boolean" ? {} : stylisticOptions
1754
+ typeof stylisticOptions === "boolean" ? {} : stylisticOptions,
1755
+ options.markdown !== false
1755
1756
  ));
1756
1757
  }
1757
1758
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "2.3.2",
4
+ "version": "2.3.4",
5
5
  "packageManager": "pnpm@8.11.0",
6
6
  "description": "Anthony's ESLint config",
7
7
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -27,7 +27,7 @@
27
27
  "peerDependencies": {
28
28
  "@unocss/eslint-plugin": ">=0.50.0",
29
29
  "eslint": ">=8.40.0",
30
- "eslint-plugin-format": "^0.0.1",
30
+ "eslint-plugin-format": ">=0.1.0",
31
31
  "eslint-plugin-react": "^7.33.2",
32
32
  "eslint-plugin-react-hooks": "^4.6.0",
33
33
  "eslint-plugin-react-refresh": "^0.4.4"
@@ -55,7 +55,7 @@
55
55
  "@eslint-types/jsdoc": "46.8.2-1",
56
56
  "@eslint-types/typescript-eslint": "^6.12.0",
57
57
  "@eslint-types/unicorn": "^49.0.0",
58
- "@stylistic/eslint-plugin": "^1.5.0-beta.0",
58
+ "@stylistic/eslint-plugin": "^1.5.0",
59
59
  "@typescript-eslint/eslint-plugin": "^6.13.2",
60
60
  "@typescript-eslint/parser": "^6.13.2",
61
61
  "eslint-config-flat-gitignore": "^0.1.2",
@@ -86,7 +86,7 @@
86
86
  "devDependencies": {
87
87
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
88
88
  "@antfu/ni": "^0.21.12",
89
- "@stylistic/eslint-plugin-migrate": "^1.4.1",
89
+ "@stylistic/eslint-plugin-migrate": "^1.5.0",
90
90
  "@types/eslint": "^8.44.8",
91
91
  "@types/fs-extra": "^11.0.4",
92
92
  "@types/node": "^20.10.3",
@@ -96,7 +96,7 @@
96
96
  "bumpp": "^9.2.0",
97
97
  "eslint": "^8.55.0",
98
98
  "eslint-flat-config-viewer": "^0.1.3",
99
- "eslint-plugin-format": "^0.0.1",
99
+ "eslint-plugin-format": "^0.1.0",
100
100
  "eslint-plugin-react": "^7.33.2",
101
101
  "eslint-plugin-react-hooks": "^4.6.0",
102
102
  "eslint-plugin-react-refresh": "^0.4.5",
@@ -110,7 +110,7 @@
110
110
  "tsup": "^8.0.1",
111
111
  "typescript": "^5.3.2",
112
112
  "vitest": "^1.0.1",
113
- "@antfu/eslint-config": "2.3.2"
113
+ "@antfu/eslint-config": "2.3.4"
114
114
  },
115
115
  "simple-git-hooks": {
116
116
  "pre-commit": "pnpm lint-staged"