@sxzz/eslint-config 7.3.2 → 7.4.1

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/index.d.mts CHANGED
@@ -12953,7 +12953,12 @@ type Config = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
12953
12953
  };
12954
12954
  //#endregion
12955
12955
  //#region src/configs/baseline.d.ts
12956
- declare const baseline: () => Config[];
12956
+ interface BaselineOptions {
12957
+ baseline?: "widely" | "newly" | number;
12958
+ available?: "widely" | "newly" | number;
12959
+ ignoreFeatures?: string[];
12960
+ }
12961
+ declare const baseline: (options?: BaselineOptions) => Config[];
12957
12962
  //#endregion
12958
12963
  //#region src/configs/command.d.ts
12959
12964
  declare const command: () => Config[];
@@ -13072,7 +13077,7 @@ declare const presetBasic: () => Config[];
13072
13077
  declare const presetAll: () => Promise<Config[]>;
13073
13078
  interface Options {
13074
13079
  /** @default true */
13075
- baseline?: boolean;
13080
+ baseline?: boolean | BaselineOptions;
13076
13081
  /** @default true */
13077
13082
  command?: boolean;
13078
13083
  /** markdown support. @default true */
@@ -13089,4 +13094,4 @@ interface Options {
13089
13094
  /** `@sxzz`'s preset. */
13090
13095
  declare function sxzz(options?: Options, ...userConfigs: Awaitable<Arrayable<Config> | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<Config, ConfigNames>;
13091
13096
  //#endregion
13092
- 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 };
13097
+ export { BaselineOptions, 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
@@ -37,12 +37,14 @@ import { isPackageExists } from "local-pkg";
37
37
  import { FlatConfigComposer } from "eslint-flat-config-utils";
38
38
 
39
39
  //#region src/configs/baseline.ts
40
- const baseline = () => [{
40
+ const baseline = (options = {}) => [{
41
41
  name: "sxzz/baseline",
42
42
  plugins: { "baseline-js": baselineJs },
43
43
  rules: { "baseline-js/use-baseline": ["warn", {
44
+ ignoreFeatures: ["functions-caller-arguments"],
44
45
  includeJsBuiltins: { preset: "auto" },
45
- includeWebApis: { preset: "auto" }
46
+ includeWebApis: { preset: "auto" },
47
+ ...options
46
48
  }] }
47
49
  }];
48
50
 
@@ -409,42 +411,44 @@ const sortPackageJson = () => [{
409
411
  "error",
410
412
  {
411
413
  order: [
414
+ "publisher",
412
415
  "name",
416
+ "displayName",
417
+ "type",
413
418
  "version",
414
419
  "private",
415
420
  "packageManager",
416
421
  "description",
417
- "type",
418
- "keywords",
419
- "license",
420
- "homepage",
421
- "bugs",
422
- "repository",
423
422
  "author",
424
423
  "contributors",
424
+ "license",
425
425
  "funding",
426
- "files",
426
+ "homepage",
427
+ "repository",
428
+ "bugs",
429
+ "keywords",
430
+ "categories",
431
+ "sideEffects",
432
+ "imports",
433
+ "exports",
427
434
  "main",
428
435
  "module",
429
- "types",
430
- "exports",
431
- "typesVersions",
432
- "sideEffects",
433
436
  "unpkg",
434
437
  "jsdelivr",
435
- "browser",
438
+ "types",
439
+ "typesVersions",
436
440
  "bin",
437
- "man",
438
- "directories",
439
- "publishConfig",
441
+ "icon",
442
+ "files",
443
+ "engines",
444
+ "activationEvents",
445
+ "contributes",
440
446
  "scripts",
441
447
  "peerDependencies",
442
448
  "peerDependenciesMeta",
443
- "optionalDependencies",
444
449
  "dependencies",
450
+ "optionalDependencies",
445
451
  "devDependencies",
446
- "engines",
447
- "config",
448
452
  "pnpm",
449
453
  "overrides",
450
454
  "resolutions",
@@ -478,7 +482,7 @@ const sortPackageJson = () => [{
478
482
  }
479
483
  }];
480
484
  const sortTsconfig = () => [{
481
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
485
+ files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
482
486
  name: "sxzz/sort/tsconfig",
483
487
  rules: { "jsonc/sort-keys": [
484
488
  "error",
@@ -513,6 +517,7 @@ const sortTsconfig = () => [{
513
517
  "useDefineForClassFields",
514
518
  "emitDecoratorMetadata",
515
519
  "experimentalDecorators",
520
+ "libReplacement",
516
521
  "baseUrl",
517
522
  "rootDir",
518
523
  "rootDirs",
@@ -562,7 +567,6 @@ const sortTsconfig = () => [{
562
567
  "importsNotUsedAsValues",
563
568
  "inlineSourceMap",
564
569
  "inlineSources",
565
- "isolatedDeclarations",
566
570
  "mapRoot",
567
571
  "newLine",
568
572
  "noEmit",
@@ -577,12 +581,13 @@ const sortTsconfig = () => [{
577
581
  "sourceRoot",
578
582
  "stripInternal",
579
583
  "allowSyntheticDefaultImports",
580
- "erasableSyntaxOnly",
581
584
  "esModuleInterop",
582
585
  "forceConsistentCasingInFileNames",
586
+ "isolatedDeclarations",
583
587
  "isolatedModules",
584
588
  "preserveSymlinks",
585
589
  "verbatimModuleSyntax",
590
+ "erasableSyntaxOnly",
586
591
  "skipDefaultLibCheck",
587
592
  "skipLibCheck"
588
593
  ],
@@ -623,6 +628,10 @@ const sortImports = () => [{
623
628
  name: "sxzz/sort/imports",
624
629
  plugins: { perfectionist: pluginPerfectionist },
625
630
  rules: {
631
+ "perfectionist/sort-exports": ["error", {
632
+ groups: ["value-export", "type-export"],
633
+ type: "natural"
634
+ }],
626
635
  "perfectionist/sort-imports": ["warn", {
627
636
  groups: [
628
637
  "builtin",
@@ -641,10 +650,17 @@ const sortImports = () => [{
641
650
  "side-effect-style"
642
651
  ],
643
652
  internalPattern: ["^[~@#]/.*"],
644
- newlinesBetween: "ignore"
653
+ newlinesBetween: "ignore",
654
+ type: "natural"
655
+ }],
656
+ "perfectionist/sort-named-exports": ["warn", {
657
+ groupKind: "values-first",
658
+ type: "natural"
645
659
  }],
646
- "perfectionist/sort-named-exports": ["warn", { groupKind: "values-first" }],
647
- "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }]
660
+ "perfectionist/sort-named-imports": ["warn", {
661
+ groupKind: "values-first",
662
+ type: "natural"
663
+ }]
648
664
  }
649
665
  }];
650
666
 
@@ -980,7 +996,7 @@ function sxzz(options = {}, ...userConfigs) {
980
996
  yml(),
981
997
  presetJsonc()
982
998
  ];
983
- if (enableBaseline) configs$1.push(baseline());
999
+ if (enableBaseline) configs$1.push(baseline(typeof enableBaseline === "object" ? enableBaseline : {}));
984
1000
  if (enableVue) configs$1.push(vue());
985
1001
  if (enableMarkdown) configs$1.push(markdown());
986
1002
  if (enableUnocss) configs$1.push(unocss());
package/package.json CHANGED
@@ -1,32 +1,35 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "7.3.2",
4
- "description": "ESLint config for @sxzz.",
5
3
  "type": "module",
4
+ "version": "7.4.1",
5
+ "description": "ESLint config for @sxzz.",
6
+ "author": "Kevin Deng <sxzz@sxzz.moe>",
6
7
  "license": "MIT",
8
+ "funding": "https://github.com/sponsors/sxzz",
7
9
  "homepage": "https://github.com/sxzz/eslint-config#readme",
8
- "bugs": {
9
- "url": "https://github.com/sxzz/eslint-config/issues"
10
- },
11
10
  "repository": {
12
11
  "type": "git",
13
12
  "url": "git+https://github.com/sxzz/eslint-config.git"
14
13
  },
15
- "author": "Kevin Deng <sxzz@sxzz.moe>",
16
- "funding": "https://github.com/sponsors/sxzz",
17
- "files": [
18
- "dist"
19
- ],
20
- "main": "./dist/index.mjs",
21
- "module": "./dist/index.mjs",
22
- "types": "./dist/index.d.mts",
14
+ "bugs": {
15
+ "url": "https://github.com/sxzz/eslint-config/issues"
16
+ },
23
17
  "exports": {
24
18
  ".": "./dist/index.mjs",
25
19
  "./package.json": "./package.json"
26
20
  },
21
+ "main": "./dist/index.mjs",
22
+ "module": "./dist/index.mjs",
23
+ "types": "./dist/index.d.mts",
24
+ "files": [
25
+ "dist"
26
+ ],
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
+ "engines": {
31
+ "node": ">=20.0.0"
32
+ },
30
33
  "peerDependencies": {
31
34
  "@unocss/eslint-plugin": ">=65.0.0",
32
35
  "eslint": "^9.5.0"
@@ -44,11 +47,11 @@
44
47
  "eslint-config-prettier": "^10.1.8",
45
48
  "eslint-flat-config-utils": "^2.1.4",
46
49
  "eslint-plugin-antfu": "^3.1.1",
47
- "eslint-plugin-baseline-js": "^0.4.1",
50
+ "eslint-plugin-baseline-js": "^0.4.2",
48
51
  "eslint-plugin-command": "^3.3.1",
49
52
  "eslint-plugin-de-morgan": "^2.0.0",
50
53
  "eslint-plugin-import-x": "^4.16.1",
51
- "eslint-plugin-jsdoc": "^61.4.0",
54
+ "eslint-plugin-jsdoc": "^61.4.1",
52
55
  "eslint-plugin-jsonc": "^2.21.0",
53
56
  "eslint-plugin-n": "^17.23.1",
54
57
  "eslint-plugin-perfectionist": "^4.15.1",
@@ -58,31 +61,28 @@
58
61
  "eslint-plugin-sxzz": "^0.4.1",
59
62
  "eslint-plugin-unicorn": "^62.0.0",
60
63
  "eslint-plugin-unused-imports": "^4.3.0",
61
- "eslint-plugin-vue": "^10.6.0",
64
+ "eslint-plugin-vue": "^10.6.2",
62
65
  "eslint-plugin-yml": "^1.19.0",
63
66
  "globals": "^16.5.0",
64
67
  "jsonc-eslint-parser": "^2.4.1",
65
68
  "local-pkg": "^1.1.2",
66
- "prettier": "^3.6.2",
67
- "typescript-eslint": "^8.47.0",
69
+ "typescript-eslint": "^8.48.0",
68
70
  "vue-eslint-parser": "^10.2.0",
69
- "yaml-eslint-parser": "^1.3.0"
71
+ "yaml-eslint-parser": "^1.3.1"
70
72
  },
71
73
  "devDependencies": {
72
- "@eslint/config-inspector": "^1.4.1",
73
- "@sxzz/prettier-config": "^2.2.5",
74
+ "@eslint/config-inspector": "^1.4.2",
75
+ "@sxzz/prettier-config": "^2.2.6",
74
76
  "@types/node": "^24.10.1",
75
77
  "@unocss/eslint-plugin": "^66.5.9",
76
- "bumpp": "^10.3.1",
78
+ "bumpp": "^10.3.2",
77
79
  "eslint": "^9.39.1",
78
80
  "eslint-typegen": "^2.3.0",
81
+ "prettier": "^3.7.1",
79
82
  "rolldown-plugin-require-cjs": "^0.3.1",
80
- "tsdown": "^0.16.6",
83
+ "tsdown": "^0.16.8",
81
84
  "typescript": "^5.9.3",
82
- "unrun": "^0.2.11"
83
- },
84
- "engines": {
85
- "node": ">=20.0.0"
85
+ "unrun": "^0.2.13"
86
86
  },
87
87
  "resolutions": {
88
88
  "@types/eslint": "-"