@sxzz/eslint-config 7.6.0 → 7.6.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/README.md CHANGED
@@ -26,6 +26,13 @@ npm i -D @sxzz/eslint-config
26
26
 
27
27
  Require Node.js >= 20.0.0, and ESLint >= 9.5.0.
28
28
 
29
+ ### Optional Dependencies
30
+
31
+ | Feature | Optional Dependency |
32
+ | ------- | ------------------- |
33
+ | Astro | `eslint-plugin-astro` |
34
+ | UnoCSS | `@unocss/eslint-plugin` |
35
+
29
36
  ## Usage
30
37
 
31
38
  ```js
package/dist/index.d.mts CHANGED
@@ -9480,7 +9480,7 @@ type PerfectionistSortArrayIncludes = {
9480
9480
  pattern: string;
9481
9481
  flags?: string;
9482
9482
  } | string));
9483
- selector?: ("literal" | "spread");
9483
+ selector?: "literal";
9484
9484
  }, ...({
9485
9485
  elementNamePattern?: (({
9486
9486
  pattern: string;
@@ -9489,7 +9489,7 @@ type PerfectionistSortArrayIncludes = {
9489
9489
  pattern: string;
9490
9490
  flags?: string;
9491
9491
  } | string));
9492
- selector?: ("literal" | "spread");
9492
+ selector?: "literal";
9493
9493
  })[]];
9494
9494
  } | {
9495
9495
  fallbackSort?: {
@@ -9507,7 +9507,7 @@ type PerfectionistSortArrayIncludes = {
9507
9507
  pattern: string;
9508
9508
  flags?: string;
9509
9509
  } | string));
9510
- selector?: ("literal" | "spread");
9510
+ selector?: "literal";
9511
9511
  })[];
9512
9512
  newlinesInside?: (("ignore" | number) | "newlinesBetween");
9513
9513
  groups?: (string | [string, ...(string)[]] | {
@@ -9674,6 +9674,7 @@ type PerfectionistSortClasses = [] | [{
9674
9674
  order?: ("asc" | "desc");
9675
9675
  })[];
9676
9676
  newlinesBetween?: ("ignore" | number);
9677
+ useExperimentalDependencyDetection?: boolean;
9677
9678
  ignoreCallbackDependenciesPatterns?: (({
9678
9679
  pattern: string;
9679
9680
  flags?: string;
@@ -11560,7 +11561,7 @@ type PerfectionistSortSets = {
11560
11561
  pattern: string;
11561
11562
  flags?: string;
11562
11563
  } | string));
11563
- selector?: ("literal" | "spread");
11564
+ selector?: "literal";
11564
11565
  }, ...({
11565
11566
  elementNamePattern?: (({
11566
11567
  pattern: string;
@@ -11569,7 +11570,7 @@ type PerfectionistSortSets = {
11569
11570
  pattern: string;
11570
11571
  flags?: string;
11571
11572
  } | string));
11572
- selector?: ("literal" | "spread");
11573
+ selector?: "literal";
11573
11574
  })[]];
11574
11575
  } | {
11575
11576
  fallbackSort?: {
@@ -11587,7 +11588,7 @@ type PerfectionistSortSets = {
11587
11588
  pattern: string;
11588
11589
  flags?: string;
11589
11590
  } | string));
11590
- selector?: ("literal" | "spread");
11591
+ selector?: "literal";
11591
11592
  })[];
11592
11593
  newlinesInside?: (("ignore" | number) | "newlinesBetween");
11593
11594
  groups?: (string | [string, ...(string)[]] | {
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 { createRequire } from "node:module";
3
4
  import baselineJs from "eslint-plugin-baseline-js";
4
5
  import pluginAntfu from "eslint-plugin-antfu";
5
6
  import pluginSxzz from "eslint-plugin-sxzz";
@@ -30,9 +31,12 @@ const {
30
31
  defineConfig
31
32
  } = __cjs_require("eslint/config");
32
33
  import process from "node:process";
33
- import { isPackageExists } from "local-pkg";
34
34
  import { FlatConfigComposer } from "eslint-flat-config-utils";
35
35
 
36
+ //#region \0rolldown/runtime.js
37
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
+
39
+ //#endregion
36
40
  //#region src/utils.ts
37
41
  async function importWithError(pkg) {
38
42
  try {
@@ -45,7 +49,7 @@ async function importWithError(pkg) {
45
49
  //#endregion
46
50
  //#region src/configs/astro.ts
47
51
  const astro = async () => {
48
- return (await importWithError("eslint-plugin-astro")).default.configs.recommended.map((config) => ({
52
+ return (await importWithError("eslint-plugin-astro")).configs.recommended.map((config) => ({
49
53
  ...config,
50
54
  name: `sxzz/${config.name || "anonymous"}`
51
55
  }));
@@ -820,9 +824,8 @@ const unicorn = () => [{
820
824
  //#endregion
821
825
  //#region src/configs/unocss.ts
822
826
  const unocss = async () => {
823
- const { default: unocss } = await importWithError("@unocss/eslint-plugin");
824
827
  return [{
825
- ...unocss.configs.flat,
828
+ ...(await importWithError("@unocss/eslint-plugin")).configs.flat,
826
829
  name: "sxzz/unocss"
827
830
  }];
828
831
  };
@@ -934,6 +937,15 @@ const yml = () => [...yamlConfigs.map((config) => ({
934
937
 
935
938
  //#endregion
936
939
  //#region src/env.ts
940
+ const cwd = process.cwd();
941
+ function isPackageExists(name) {
942
+ try {
943
+ __require.resolve(name, { paths: [cwd] });
944
+ return true;
945
+ } catch {
946
+ return false;
947
+ }
948
+ }
937
949
  const hasTypeScript = () => isPackageExists("typescript");
938
950
  const hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli");
939
951
  const hasAstro = () => isPackageExists("astro");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
3
  "type": "module",
4
- "version": "7.6.0",
4
+ "version": "7.6.1",
5
5
  "description": "ESLint config for @sxzz.",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "peerDependencies": {
32
32
  "@unocss/eslint-plugin": ">=65.0.0",
33
33
  "eslint": "^9.5.0",
34
- "eslint-plugin-astro": ">=1.0.0"
34
+ "eslint-plugin-astro": "^1.5.0"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@unocss/eslint-plugin": {
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
46
- "@eslint/js": "^9.39.2",
46
+ "@eslint/js": "^10.0.1",
47
47
  "@eslint/markdown": "^7.5.1",
48
48
  "eslint-config-flat-gitignore": "^2.1.0",
49
49
  "eslint-config-prettier": "^10.1.8",
@@ -53,10 +53,10 @@
53
53
  "eslint-plugin-command": "^3.4.0",
54
54
  "eslint-plugin-de-morgan": "^2.0.0",
55
55
  "eslint-plugin-importer": "^0.2.1",
56
- "eslint-plugin-jsdoc": "^62.5.0",
56
+ "eslint-plugin-jsdoc": "^62.5.2",
57
57
  "eslint-plugin-jsonc": "^2.21.0",
58
58
  "eslint-plugin-n": "^17.23.2",
59
- "eslint-plugin-perfectionist": "^5.4.0",
59
+ "eslint-plugin-perfectionist": "^5.5.0",
60
60
  "eslint-plugin-pnpm": "^1.5.0",
61
61
  "eslint-plugin-prettier": "^5.5.5",
62
62
  "eslint-plugin-regexp": "^3.0.0",
@@ -67,26 +67,25 @@
67
67
  "eslint-plugin-yml": "^3.0.0",
68
68
  "globals": "^17.3.0",
69
69
  "jsonc-eslint-parser": "^2.4.2",
70
- "local-pkg": "^1.1.2",
71
70
  "typescript-eslint": "^8.54.0",
72
71
  "vue-eslint-parser": "^10.2.0"
73
72
  },
74
73
  "devDependencies": {
75
74
  "@eslint/config-inspector": "^1.4.2",
76
- "@sxzz/prettier-config": "^2.3.0",
77
- "@types/node": "^25.2.0",
78
- "@typescript/native-preview": "7.0.0-dev.20260202.1",
75
+ "@sxzz/prettier-config": "^2.3.1",
76
+ "@types/node": "^25.2.1",
77
+ "@typescript/native-preview": "7.0.0-dev.20260206.1",
79
78
  "@unocss/eslint-plugin": "^66.6.0",
80
- "bumpp": "^10.4.0",
79
+ "bumpp": "^10.4.1",
81
80
  "eslint": "^9.39.2",
82
81
  "eslint-plugin-astro": "^1.5.0",
83
82
  "eslint-typegen": "^2.3.0",
84
83
  "prettier": "^3.8.1",
85
84
  "rolldown-plugin-require-cjs": "^0.3.3",
86
- "tsdown": "^0.20.1",
87
- "tsdown-preset-sxzz": "^0.3.1",
85
+ "tsdown": "^0.20.3",
86
+ "tsdown-preset-sxzz": "^0.3.2",
88
87
  "typescript": "^5.9.3",
89
- "unrun": "^0.2.26"
88
+ "unrun": "^0.2.27"
90
89
  },
91
90
  "resolutions": {
92
91
  "@types/eslint": "-"