@antfu/eslint-config 3.1.0 → 3.2.0

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
@@ -48,7 +48,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
48
48
  var package_default = {
49
49
  name: "@antfu/eslint-config",
50
50
  type: "module",
51
- version: "3.1.0",
51
+ version: "3.2.0",
52
52
  packageManager: "pnpm@9.9.0",
53
53
  description: "Anthony's ESLint config",
54
54
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import c from "picocolors";
19
19
  var package_default = {
20
20
  name: "@antfu/eslint-config",
21
21
  type: "module",
22
- version: "3.1.0",
22
+ version: "3.2.0",
23
23
  packageManager: "pnpm@9.9.0",
24
24
  description: "Anthony's ESLint config",
25
25
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
package/dist/index.cjs CHANGED
@@ -68,6 +68,7 @@ __export(src_exports, {
68
68
  comments: () => comments,
69
69
  default: () => src_default,
70
70
  defaultPluginRenaming: () => defaultPluginRenaming,
71
+ disables: () => disables,
71
72
  ensurePackages: () => ensurePackages,
72
73
  formatters: () => formatters,
73
74
  getOverrides: () => getOverrides,
@@ -338,7 +339,6 @@ async function astro(options = {}) {
338
339
  ...stylistic2 ? {
339
340
  "style/indent": "off",
340
341
  "style/jsx-closing-tag-location": "off",
341
- "style/jsx-indent": "off",
342
342
  "style/jsx-one-expression-per-line": "off",
343
343
  "style/no-multiple-empty-lines": "off"
344
344
  } : {},
@@ -763,14 +763,6 @@ async function imports(options = {}) {
763
763
  "import/newline-after-import": ["error", { count: 1 }]
764
764
  } : {}
765
765
  }
766
- },
767
- {
768
- files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
769
- name: "antfu/imports/disables/bin",
770
- rules: {
771
- "antfu/no-import-dist": "off",
772
- "antfu/no-import-node-modules-by-path": "off"
773
- }
774
766
  }
775
767
  ];
776
768
  }
@@ -986,13 +978,6 @@ async function javascript(options = {}) {
986
978
  "yoda": ["error", "never"],
987
979
  ...overrides
988
980
  }
989
- },
990
- {
991
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
992
- name: "antfu/javascript/disables/cli",
993
- rules: {
994
- "no-console": "off"
995
- }
996
981
  }
997
982
  ];
998
983
  }
@@ -1194,7 +1179,6 @@ async function markdown(options = {}) {
1194
1179
  "ts/no-unused-expressions": "off",
1195
1180
  "ts/no-unused-vars": "off",
1196
1181
  "ts/no-use-before-define": "off",
1197
- "ts/no-var-requires": "off",
1198
1182
  "unicode-bom": "off",
1199
1183
  "unused-imports/no-unused-imports": "off",
1200
1184
  "unused-imports/no-unused-vars": "off",
@@ -1839,6 +1823,7 @@ async function test(options = {}) {
1839
1823
  "test/prefer-hooks-in-order": "error",
1840
1824
  "test/prefer-lowercase-title": "error",
1841
1825
  "ts/explicit-function-return-type": "off",
1826
+ "unicorn/consistent-function-scoping": "off",
1842
1827
  ...overrides
1843
1828
  }
1844
1829
  }
@@ -2007,7 +1992,6 @@ async function typescript(options = {}) {
2007
1992
  { "@typescript-eslint": "ts" }
2008
1993
  ),
2009
1994
  "no-dupe-class-members": "off",
2010
- "no-loss-of-precision": "off",
2011
1995
  "no-redeclare": "off",
2012
1996
  "no-use-before-define": "off",
2013
1997
  "no-useless-constructor": "off",
@@ -2026,7 +2010,6 @@ async function typescript(options = {}) {
2026
2010
  "ts/no-extraneous-class": "off",
2027
2011
  "ts/no-import-type-side-effects": "error",
2028
2012
  "ts/no-invalid-void-type": "off",
2029
- "ts/no-loss-of-precision": "error",
2030
2013
  "ts/no-non-null-assertion": "off",
2031
2014
  "ts/no-redeclare": "error",
2032
2015
  "ts/no-require-imports": "error",
@@ -2054,32 +2037,7 @@ async function typescript(options = {}) {
2054
2037
  ...typeAwareRules,
2055
2038
  ...overridesTypeAware
2056
2039
  }
2057
- }] : [],
2058
- {
2059
- files: ["**/*.d.?([cm])ts"],
2060
- name: "antfu/typescript/disables/dts",
2061
- rules: {
2062
- "eslint-comments/no-unlimited-disable": "off",
2063
- "import/no-duplicates": "off",
2064
- "no-restricted-syntax": "off",
2065
- "unused-imports/no-unused-vars": "off"
2066
- }
2067
- },
2068
- {
2069
- files: ["**/*.{test,spec}.ts?(x)"],
2070
- name: "antfu/typescript/disables/test",
2071
- rules: {
2072
- "no-unused-expressions": "off"
2073
- }
2074
- },
2075
- {
2076
- files: ["**/*.js", "**/*.cjs"],
2077
- name: "antfu/typescript/disables/cjs",
2078
- rules: {
2079
- "ts/no-require-imports": "off",
2080
- "ts/no-var-requires": "off"
2081
- }
2082
- }
2040
+ }] : []
2083
2041
  ];
2084
2042
  }
2085
2043
 
@@ -2399,6 +2357,60 @@ async function regexp(options = {}) {
2399
2357
  ];
2400
2358
  }
2401
2359
 
2360
+ // src/configs/disables.ts
2361
+ async function disables() {
2362
+ return [
2363
+ {
2364
+ files: [`scripts/${GLOB_SRC}`],
2365
+ name: "antfu/disables/scripts",
2366
+ rules: {
2367
+ "no-console": "off",
2368
+ "ts/explicit-function-return-type": "off",
2369
+ "unicorn/consistent-function-scoping": "off"
2370
+ }
2371
+ },
2372
+ {
2373
+ files: [`cli/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
2374
+ name: "antfu/disables/cli",
2375
+ rules: {
2376
+ "no-console": "off"
2377
+ }
2378
+ },
2379
+ {
2380
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
2381
+ name: "antfu/disables/bin",
2382
+ rules: {
2383
+ "antfu/no-import-dist": "off",
2384
+ "antfu/no-import-node-modules-by-path": "off"
2385
+ }
2386
+ },
2387
+ {
2388
+ files: ["**/*.d.?([cm])ts"],
2389
+ name: "antfu/disables/dts",
2390
+ rules: {
2391
+ "eslint-comments/no-unlimited-disable": "off",
2392
+ "import/no-duplicates": "off",
2393
+ "no-restricted-syntax": "off",
2394
+ "unused-imports/no-unused-vars": "off"
2395
+ }
2396
+ },
2397
+ {
2398
+ files: ["**/*.{test,spec}.([tj])s?(x)"],
2399
+ name: "antfu/disables/test",
2400
+ rules: {
2401
+ "no-unused-expressions": "off"
2402
+ }
2403
+ },
2404
+ {
2405
+ files: ["**/*.js", "**/*.cjs"],
2406
+ name: "antfu/disables/cjs",
2407
+ rules: {
2408
+ "ts/no-require-imports": "off"
2409
+ }
2410
+ }
2411
+ ];
2412
+ }
2413
+
2402
2414
  // src/factory.ts
2403
2415
  var flatConfigProps = [
2404
2416
  "name",
@@ -2597,6 +2609,9 @@ function antfu(options = {}, ...userConfigs) {
2597
2609
  typeof stylisticOptions === "boolean" ? {} : stylisticOptions
2598
2610
  ));
2599
2611
  }
2612
+ configs2.push(
2613
+ disables()
2614
+ );
2600
2615
  if ("files" in options) {
2601
2616
  throw new Error('[@antfu/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
2602
2617
  }
@@ -2669,6 +2684,7 @@ var src_default = antfu;
2669
2684
  command,
2670
2685
  comments,
2671
2686
  defaultPluginRenaming,
2687
+ disables,
2672
2688
  ensurePackages,
2673
2689
  formatters,
2674
2690
  getOverrides,
package/dist/index.d.cts CHANGED
@@ -15152,7 +15152,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
15152
15152
  onlyEquality?: boolean
15153
15153
  }]
15154
15154
  // Names of all the configs
15155
- type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/imports/disables/bin' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/javascript/disables/cli' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/typescript/disables/dts' | 'antfu/typescript/disables/test' | 'antfu/typescript/disables/cjs' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules'
15155
+ type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules'
15156
15156
 
15157
15157
  type Awaitable<T> = T | Promise<T>;
15158
15158
  type Rules = RuleOptions;
@@ -15624,6 +15624,8 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
15624
15624
 
15625
15625
  declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
15626
15626
 
15627
+ declare function disables(): Promise<TypedFlatConfigItem[]>;
15628
+
15627
15629
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
15628
15630
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
15629
15631
  declare const GLOB_JS = "**/*.?([cm])js";
@@ -15727,4 +15729,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
15727
15729
  declare function isInEditorEnv(): boolean;
15728
15730
  declare function isInGitHooksOrLintStaged(): boolean;
15729
15731
 
15730
- export { type Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, 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_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
15732
+ export { type Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, 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_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.d.ts CHANGED
@@ -15152,7 +15152,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
15152
15152
  onlyEquality?: boolean
15153
15153
  }]
15154
15154
  // Names of all the configs
15155
- type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/imports/disables/bin' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/javascript/disables/cli' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/typescript/disables/dts' | 'antfu/typescript/disables/test' | 'antfu/typescript/disables/cjs' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules'
15155
+ type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules'
15156
15156
 
15157
15157
  type Awaitable<T> = T | Promise<T>;
15158
15158
  type Rules = RuleOptions;
@@ -15624,6 +15624,8 @@ declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
15624
15624
 
15625
15625
  declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
15626
15626
 
15627
+ declare function disables(): Promise<TypedFlatConfigItem[]>;
15628
+
15627
15629
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
15628
15630
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
15629
15631
  declare const GLOB_JS = "**/*.?([cm])js";
@@ -15727,4 +15729,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
15727
15729
  declare function isInEditorEnv(): boolean;
15728
15730
  declare function isInGitHooksOrLintStaged(): boolean;
15729
15731
 
15730
- export { type Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, 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_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
15732
+ export { type Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, 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_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -226,7 +226,6 @@ async function astro(options = {}) {
226
226
  ...stylistic2 ? {
227
227
  "style/indent": "off",
228
228
  "style/jsx-closing-tag-location": "off",
229
- "style/jsx-indent": "off",
230
229
  "style/jsx-one-expression-per-line": "off",
231
230
  "style/no-multiple-empty-lines": "off"
232
231
  } : {},
@@ -651,14 +650,6 @@ async function imports(options = {}) {
651
650
  "import/newline-after-import": ["error", { count: 1 }]
652
651
  } : {}
653
652
  }
654
- },
655
- {
656
- files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
657
- name: "antfu/imports/disables/bin",
658
- rules: {
659
- "antfu/no-import-dist": "off",
660
- "antfu/no-import-node-modules-by-path": "off"
661
- }
662
653
  }
663
654
  ];
664
655
  }
@@ -874,13 +865,6 @@ async function javascript(options = {}) {
874
865
  "yoda": ["error", "never"],
875
866
  ...overrides
876
867
  }
877
- },
878
- {
879
- files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
880
- name: "antfu/javascript/disables/cli",
881
- rules: {
882
- "no-console": "off"
883
- }
884
868
  }
885
869
  ];
886
870
  }
@@ -1082,7 +1066,6 @@ async function markdown(options = {}) {
1082
1066
  "ts/no-unused-expressions": "off",
1083
1067
  "ts/no-unused-vars": "off",
1084
1068
  "ts/no-use-before-define": "off",
1085
- "ts/no-var-requires": "off",
1086
1069
  "unicode-bom": "off",
1087
1070
  "unused-imports/no-unused-imports": "off",
1088
1071
  "unused-imports/no-unused-vars": "off",
@@ -1727,6 +1710,7 @@ async function test(options = {}) {
1727
1710
  "test/prefer-hooks-in-order": "error",
1728
1711
  "test/prefer-lowercase-title": "error",
1729
1712
  "ts/explicit-function-return-type": "off",
1713
+ "unicorn/consistent-function-scoping": "off",
1730
1714
  ...overrides
1731
1715
  }
1732
1716
  }
@@ -1895,7 +1879,6 @@ async function typescript(options = {}) {
1895
1879
  { "@typescript-eslint": "ts" }
1896
1880
  ),
1897
1881
  "no-dupe-class-members": "off",
1898
- "no-loss-of-precision": "off",
1899
1882
  "no-redeclare": "off",
1900
1883
  "no-use-before-define": "off",
1901
1884
  "no-useless-constructor": "off",
@@ -1914,7 +1897,6 @@ async function typescript(options = {}) {
1914
1897
  "ts/no-extraneous-class": "off",
1915
1898
  "ts/no-import-type-side-effects": "error",
1916
1899
  "ts/no-invalid-void-type": "off",
1917
- "ts/no-loss-of-precision": "error",
1918
1900
  "ts/no-non-null-assertion": "off",
1919
1901
  "ts/no-redeclare": "error",
1920
1902
  "ts/no-require-imports": "error",
@@ -1942,32 +1924,7 @@ async function typescript(options = {}) {
1942
1924
  ...typeAwareRules,
1943
1925
  ...overridesTypeAware
1944
1926
  }
1945
- }] : [],
1946
- {
1947
- files: ["**/*.d.?([cm])ts"],
1948
- name: "antfu/typescript/disables/dts",
1949
- rules: {
1950
- "eslint-comments/no-unlimited-disable": "off",
1951
- "import/no-duplicates": "off",
1952
- "no-restricted-syntax": "off",
1953
- "unused-imports/no-unused-vars": "off"
1954
- }
1955
- },
1956
- {
1957
- files: ["**/*.{test,spec}.ts?(x)"],
1958
- name: "antfu/typescript/disables/test",
1959
- rules: {
1960
- "no-unused-expressions": "off"
1961
- }
1962
- },
1963
- {
1964
- files: ["**/*.js", "**/*.cjs"],
1965
- name: "antfu/typescript/disables/cjs",
1966
- rules: {
1967
- "ts/no-require-imports": "off",
1968
- "ts/no-var-requires": "off"
1969
- }
1970
- }
1927
+ }] : []
1971
1928
  ];
1972
1929
  }
1973
1930
 
@@ -2287,6 +2244,60 @@ async function regexp(options = {}) {
2287
2244
  ];
2288
2245
  }
2289
2246
 
2247
+ // src/configs/disables.ts
2248
+ async function disables() {
2249
+ return [
2250
+ {
2251
+ files: [`scripts/${GLOB_SRC}`],
2252
+ name: "antfu/disables/scripts",
2253
+ rules: {
2254
+ "no-console": "off",
2255
+ "ts/explicit-function-return-type": "off",
2256
+ "unicorn/consistent-function-scoping": "off"
2257
+ }
2258
+ },
2259
+ {
2260
+ files: [`cli/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
2261
+ name: "antfu/disables/cli",
2262
+ rules: {
2263
+ "no-console": "off"
2264
+ }
2265
+ },
2266
+ {
2267
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
2268
+ name: "antfu/disables/bin",
2269
+ rules: {
2270
+ "antfu/no-import-dist": "off",
2271
+ "antfu/no-import-node-modules-by-path": "off"
2272
+ }
2273
+ },
2274
+ {
2275
+ files: ["**/*.d.?([cm])ts"],
2276
+ name: "antfu/disables/dts",
2277
+ rules: {
2278
+ "eslint-comments/no-unlimited-disable": "off",
2279
+ "import/no-duplicates": "off",
2280
+ "no-restricted-syntax": "off",
2281
+ "unused-imports/no-unused-vars": "off"
2282
+ }
2283
+ },
2284
+ {
2285
+ files: ["**/*.{test,spec}.([tj])s?(x)"],
2286
+ name: "antfu/disables/test",
2287
+ rules: {
2288
+ "no-unused-expressions": "off"
2289
+ }
2290
+ },
2291
+ {
2292
+ files: ["**/*.js", "**/*.cjs"],
2293
+ name: "antfu/disables/cjs",
2294
+ rules: {
2295
+ "ts/no-require-imports": "off"
2296
+ }
2297
+ }
2298
+ ];
2299
+ }
2300
+
2290
2301
  // src/factory.ts
2291
2302
  var flatConfigProps = [
2292
2303
  "name",
@@ -2485,6 +2496,9 @@ function antfu(options = {}, ...userConfigs) {
2485
2496
  typeof stylisticOptions === "boolean" ? {} : stylisticOptions
2486
2497
  ));
2487
2498
  }
2499
+ configs2.push(
2500
+ disables()
2501
+ );
2488
2502
  if ("files" in options) {
2489
2503
  throw new Error('[@antfu/eslint-config] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.');
2490
2504
  }
@@ -2557,6 +2571,7 @@ export {
2557
2571
  comments,
2558
2572
  src_default as default,
2559
2573
  defaultPluginRenaming,
2574
+ disables,
2560
2575
  ensurePackages,
2561
2576
  formatters,
2562
2577
  getOverrides,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "3.1.0",
4
+ "version": "3.2.0",
5
5
  "description": "Anthony's ESLint config",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
7
7
  "license": "MIT",
@@ -156,7 +156,7 @@
156
156
  "typescript": "^5.5.4",
157
157
  "vitest": "^2.0.5",
158
158
  "vue": "^3.5.0",
159
- "@antfu/eslint-config": "3.1.0"
159
+ "@antfu/eslint-config": "3.2.0"
160
160
  },
161
161
  "resolutions": {
162
162
  "@eslint-community/eslint-utils": "^4.4.0",