@sxzz/eslint-config 7.2.9 → 7.3.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/README.md CHANGED
@@ -24,7 +24,7 @@ and Prettier.
24
24
  npm i -D @sxzz/eslint-config
25
25
  ```
26
26
 
27
- Require Node.js >= 18.18, and ESLint >= 9.5.0.
27
+ Require Node.js >= 20.0.0, and ESLint >= 9.5.0.
28
28
 
29
29
  ## Usage
30
30
 
package/dist/index.d.mts CHANGED
@@ -516,6 +516,11 @@ interface Rules {
516
516
  */
517
517
  "@typescript-eslint/no-unused-expressions"?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
518
518
  /**
519
+ * Disallow unused private class members
520
+ * @see https://typescript-eslint.io/rules/no-unused-private-class-members
521
+ */
522
+ "@typescript-eslint/no-unused-private-class-members"?: Linter.RuleEntry<[]>;
523
+ /**
519
524
  * Disallow unused variables
520
525
  * @see https://typescript-eslint.io/rules/no-unused-vars
521
526
  */
@@ -835,6 +840,26 @@ interface Rules {
835
840
  */
836
841
  "arrow-spacing"?: Linter.RuleEntry<ArrowSpacing>;
837
842
  /**
843
+ * disallow BigInt64Array/BigUint64Array usage
844
+ */
845
+ "baseline-js/no-bigint64array"?: Linter.RuleEntry<[]>;
846
+ /**
847
+ * disallow Function#caller and Function#arguments
848
+ */
849
+ "baseline-js/no-function-caller-arguments"?: Linter.RuleEntry<[]>;
850
+ /**
851
+ * disallow Math.sumPrecise() usage
852
+ */
853
+ "baseline-js/no-math-sum-precise"?: Linter.RuleEntry<[]>;
854
+ /**
855
+ * disallow Temporal API usage
856
+ */
857
+ "baseline-js/no-temporal"?: Linter.RuleEntry<[]>;
858
+ /**
859
+ * Enforce JS Baseline by delegating to underlying syntax rules (es-x)
860
+ */
861
+ "baseline-js/use-baseline"?: Linter.RuleEntry<BaselineJsUseBaseline>;
862
+ /**
838
863
  * Enforce the use of variables within the scope they are defined
839
864
  * @see https://eslint.org/docs/latest/rules/block-scoped-var
840
865
  */
@@ -7118,6 +7143,26 @@ type ArrowSpacing = [] | [{
7118
7143
  before?: boolean;
7119
7144
  after?: boolean;
7120
7145
  }];
7146
+ type BaselineJsUseBaseline = [] | [{
7147
+ baseline?: (("widely" | "newly") | number);
7148
+ available?: (("widely" | "newly") | number);
7149
+ ignoreFeatures?: string[];
7150
+ ignoreNodeTypes?: string[];
7151
+ includeWebApis?: (boolean | {
7152
+ preset?: ("auto" | "safe" | "type-aware" | "heuristic");
7153
+ useTypes?: ("off" | "auto" | "require");
7154
+ heuristics?: ("off" | "conservative" | "aggressive");
7155
+ only?: string[];
7156
+ ignore?: string[];
7157
+ });
7158
+ includeJsBuiltins?: (boolean | {
7159
+ preset?: ("auto" | "safe" | "type-aware" | "heuristic");
7160
+ useTypes?: ("off" | "auto" | "require");
7161
+ heuristics?: ("off" | "conservative" | "aggressive");
7162
+ only?: string[];
7163
+ ignore?: string[];
7164
+ });
7165
+ }];
7121
7166
  type BlockSpacing = [] | [("always" | "never")];
7122
7167
  type BraceStyle = [] | [("1tbs" | "stroustrup" | "allman")] | [("1tbs" | "stroustrup" | "allman"), {
7123
7168
  allowSingleLine?: boolean;
@@ -7950,6 +7995,9 @@ type JsdocSortTags = [] | [{
7950
7995
  linesBetween?: number;
7951
7996
  reportIntraTagGroupSpacing?: boolean;
7952
7997
  reportTagGroupSpacing?: boolean;
7998
+ tagExceptions?: {
7999
+ [k: string]: number;
8000
+ };
7953
8001
  tagSequence?: {
7954
8002
  tags?: string[];
7955
8003
  }[];
@@ -12874,7 +12922,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
12874
12922
  exceptRange?: boolean;
12875
12923
  onlyEquality?: boolean;
12876
12924
  }];
12877
- type ConfigNames = "sxzz/global-ignores" | "sxzz/gitignore" | "sxzz/js/recommended" | "sxzz/js" | "sxzz/comments/recommended" | "sxzz/comments" | "sxzz/imports" | "sxzz/unicorn/unopinionated" | "sxzz/unicorn" | "sxzz/node" | "sxzz/jsdoc" | "sxzz/regexp" | "sxzz/de-morgan" | "sxzz/typescript > typescript-eslint/base" | "sxzz/typescript > typescript-eslint/eslint-recommended" | "sxzz/typescript > typescript-eslint/recommended" | "sxzz/typescript" | "sxzz/typescript/dts-rules" | "sxzz/typescript/cjs-rules" | "sxzz/sort/imports" | "sxzz/markdown/recommended/plugin" | "sxzz/markdown/recommended/processor" | "sxzz/markdown/recommended/code-blocks" | "sxzz/markdown-rules" | "sxzz/yaml/setup" | "sxzz/yaml/rules" | "sxzz/json" | "sxzz/sort/package.json" | "sxzz/sort/tsconfig" | "sxzz/sort/pnpm-workspace" | "sxzz/vue/typescript > typescript-eslint/base" | "sxzz/vue/typescript > typescript-eslint/eslint-recommended" | "sxzz/vue/typescript > typescript-eslint/recommended" | "sxzz/vue/typescript" | "sxzz/vue" | "sxzz/vue/reactivity-transform" | "sxzz/unocss" | "sxzz/prettier" | "sxzz/command" | "sxzz/pnpm/package-json" | "sxzz/pnpm/pnpm-workspace-yaml" | "sxzz/special/cli" | "sxzz/special/tests" | "sxzz/special/allow-default-export" | "sxzz/special/github" | "sxzz/special/components";
12925
+ type ConfigNames = "sxzz/global-ignores" | "sxzz/gitignore" | "sxzz/js/recommended" | "sxzz/js" | "sxzz/comments/recommended" | "sxzz/comments" | "sxzz/imports" | "sxzz/unicorn/unopinionated" | "sxzz/unicorn" | "sxzz/node" | "sxzz/jsdoc" | "sxzz/regexp" | "sxzz/de-morgan" | "sxzz/typescript > typescript-eslint/base" | "sxzz/typescript > typescript-eslint/eslint-recommended" | "sxzz/typescript > typescript-eslint/recommended" | "sxzz/typescript" | "sxzz/typescript/dts-rules" | "sxzz/typescript/cjs-rules" | "sxzz/sort/imports" | "sxzz/markdown/recommended/plugin" | "sxzz/markdown/recommended/processor" | "sxzz/markdown/recommended/code-blocks" | "sxzz/markdown-rules" | "sxzz/yaml/setup" | "sxzz/yaml/rules" | "sxzz/json" | "sxzz/sort/package.json" | "sxzz/sort/tsconfig" | "sxzz/sort/pnpm-workspace" | "sxzz/vue/typescript > typescript-eslint/base" | "sxzz/vue/typescript > typescript-eslint/eslint-recommended" | "sxzz/vue/typescript > typescript-eslint/recommended" | "sxzz/vue/typescript" | "sxzz/vue" | "sxzz/vue/reactivity-transform" | "sxzz/unocss" | "sxzz/prettier" | "sxzz/command" | "sxzz/pnpm/package-json" | "sxzz/pnpm/pnpm-workspace-yaml" | "sxzz/baseline" | "sxzz/special/cli" | "sxzz/special/tests" | "sxzz/special/allow-default-export" | "sxzz/special/github" | "sxzz/special/components";
12878
12926
  //#endregion
12879
12927
  //#region src/types.d.ts
12880
12928
  type Config = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
@@ -12886,6 +12934,9 @@ type Config = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
12886
12934
  plugins?: Record<string, any>;
12887
12935
  };
12888
12936
  //#endregion
12937
+ //#region src/configs/baseline.d.ts
12938
+ declare const baseline: () => Config[];
12939
+ //#endregion
12889
12940
  //#region src/configs/command.d.ts
12890
12941
  declare const command: () => Config[];
12891
12942
  //#endregion
@@ -13002,19 +13053,22 @@ declare const presetBasic: () => Config[];
13002
13053
  */
13003
13054
  declare const presetAll: () => Promise<Config[]>;
13004
13055
  interface Options {
13005
- /** Vue support. Auto-enable if detected. */
13006
- vue?: boolean;
13007
- /** Prettier support. Default: true */
13008
- prettier?: boolean;
13009
- /** markdown support. Default: true */
13056
+ /** @default true */
13057
+ baseline?: boolean;
13058
+ /** @default true */
13059
+ command?: boolean;
13060
+ /** markdown support. @default true */
13010
13061
  markdown?: boolean;
13062
+ /** @default false */
13063
+ pnpm?: boolean;
13064
+ /** Prettier support. @default true */
13065
+ prettier?: boolean;
13011
13066
  /** UnoCSS support. Auto-enable if detected. */
13012
13067
  unocss?: boolean;
13013
- sortKeys?: boolean;
13014
- command?: boolean;
13015
- pnpm?: boolean;
13068
+ /** Vue support. Auto-enable if detected. */
13069
+ vue?: boolean;
13016
13070
  }
13017
13071
  /** `@sxzz`'s preset. */
13018
13072
  declare function sxzz(options?: Options, ...userConfigs: Awaitable<Arrayable<Config> | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<Config, ConfigNames>;
13019
13073
  //#endregion
13020
- export { Config, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, Rules, command, comments, configCommand, configComments, configJs, deMorgan, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
13074
+ export { Config, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, Rules, baseline, command, comments, configCommand, configComments, configJs, deMorgan, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createRequire as __cjs_createRequire } from "node:module";
2
2
  const __cjs_require = __cjs_createRequire(import.meta.url);
3
+ import baselineJs from "eslint-plugin-baseline-js";
3
4
  import pluginAntfu from "eslint-plugin-antfu";
4
5
  import pluginSxzz from "eslint-plugin-sxzz";
5
6
  import pluginMarkdown from "@eslint/markdown";
@@ -35,6 +36,17 @@ import process from "node:process";
35
36
  import { isPackageExists } from "local-pkg";
36
37
  import { FlatConfigComposer } from "eslint-flat-config-utils";
37
38
 
39
+ //#region src/configs/baseline.ts
40
+ const baseline = () => [{
41
+ name: "sxzz/baseline",
42
+ plugins: { "baseline-js": baselineJs },
43
+ rules: { "baseline-js/use-baseline": ["warn", {
44
+ includeJsBuiltins: { preset: "auto" },
45
+ includeWebApis: { preset: "auto" }
46
+ }] }
47
+ }];
48
+
49
+ //#endregion
38
50
  //#region src/configs/command.ts
39
51
  const command = () => [{
40
52
  ...configCommand(),
@@ -597,11 +609,7 @@ const sortPnpmWorkspace = () => [{
597
609
  {
598
610
  allowLineSeparatedGroups: true,
599
611
  order: { type: "asc" },
600
- pathPattern: "^catalog$"
601
- },
602
- {
603
- order: { type: "asc" },
604
- pathPattern: `^catalogs$`
612
+ pathPattern: "^(catalog|catalogs|overrides)$"
605
613
  },
606
614
  {
607
615
  allowLineSeparatedGroups: true,
@@ -959,11 +967,12 @@ const presetAll = async () => [
959
967
  ...prettier(),
960
968
  ...command(),
961
969
  ...await pnpm(),
970
+ ...baseline(),
962
971
  ...specialCases()
963
972
  ];
964
973
  /** `@sxzz`'s preset. */
965
974
  function sxzz(options = {}, ...userConfigs) {
966
- const { command: enableCommand = true, markdown: enableMarkdown = true, pnpm: enablePnpm = false, prettier: enablePrettier = true, unocss: enableUnocss = hasUnocss(), vue: enableVue = hasVue() } = options;
975
+ const { baseline: enableBaseline = true, command: enableCommand = true, markdown: enableMarkdown = true, pnpm: enablePnpm = false, prettier: enablePrettier = true, unocss: enableUnocss = hasUnocss(), vue: enableVue = hasVue() } = options;
967
976
  const configs$1 = [
968
977
  presetBasic(),
969
978
  yml(),
@@ -975,9 +984,10 @@ function sxzz(options = {}, ...userConfigs) {
975
984
  if (enablePrettier) configs$1.push(prettier());
976
985
  if (enableCommand) configs$1.push(command());
977
986
  if (enablePnpm) configs$1.push(pnpm());
987
+ if (enableBaseline) configs$1.push(baseline());
978
988
  configs$1.push(specialCases());
979
989
  return new FlatConfigComposer(...configs$1, ...userConfigs);
980
990
  }
981
991
 
982
992
  //#endregion
983
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, configCommand, configComments, configJs, deMorgan, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
993
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, baseline, command, comments, configCommand, configComments, configJs, deMorgan, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, sxzz, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "7.2.9",
3
+ "version": "7.3.0",
4
4
  "description": "ESLint config for @sxzz.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,10 +44,11 @@
44
44
  "eslint-config-prettier": "^10.1.8",
45
45
  "eslint-flat-config-utils": "^2.1.4",
46
46
  "eslint-plugin-antfu": "^3.1.1",
47
+ "eslint-plugin-baseline-js": "^0.4.0",
47
48
  "eslint-plugin-command": "^3.3.1",
48
49
  "eslint-plugin-de-morgan": "^2.0.0",
49
50
  "eslint-plugin-import-x": "^4.16.1",
50
- "eslint-plugin-jsdoc": "^61.1.12",
51
+ "eslint-plugin-jsdoc": "^61.2.1",
51
52
  "eslint-plugin-jsonc": "^2.21.0",
52
53
  "eslint-plugin-n": "^17.23.1",
53
54
  "eslint-plugin-perfectionist": "^4.15.1",
@@ -63,22 +64,22 @@
63
64
  "jsonc-eslint-parser": "^2.4.1",
64
65
  "local-pkg": "^1.1.2",
65
66
  "prettier": "^3.6.2",
66
- "typescript-eslint": "^8.46.4",
67
+ "typescript-eslint": "^8.47.0",
67
68
  "vue-eslint-parser": "^10.2.0",
68
69
  "yaml-eslint-parser": "^1.3.0"
69
70
  },
70
71
  "devDependencies": {
71
72
  "@eslint/config-inspector": "^1.3.0",
72
- "@sxzz/prettier-config": "^2.2.4",
73
- "@types/node": "^24.10.0",
74
- "@unocss/eslint-plugin": "^66.5.5",
73
+ "@sxzz/prettier-config": "^2.2.5",
74
+ "@types/node": "^24.10.1",
75
+ "@unocss/eslint-plugin": "^66.5.6",
75
76
  "bumpp": "^10.3.1",
76
77
  "eslint": "^9.39.1",
77
78
  "eslint-typegen": "^2.3.0",
78
79
  "rolldown-plugin-require-cjs": "^0.3.1",
79
- "tsdown": "^0.16.1",
80
+ "tsdown": "^0.16.5",
80
81
  "typescript": "^5.9.3",
81
- "unrun": "^0.2.7"
82
+ "unrun": "^0.2.10"
82
83
  },
83
84
  "engines": {
84
85
  "node": ">=20.0.0"