@coderwyd/eslint-config 4.8.0 → 4.9.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.
@@ -1,4 +1,3 @@
1
- import process from "node:process";
2
1
  import createCommand from "eslint-plugin-command/config";
3
2
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
4
3
  import pluginAntfu from "eslint-plugin-antfu";
@@ -7,6 +6,7 @@ import pluginNode from "eslint-plugin-n";
7
6
  import pluginPerfectionist from "eslint-plugin-perfectionist";
8
7
  import pluginUnicorn from "eslint-plugin-unicorn";
9
8
  import pluginUnusedImports from "eslint-plugin-unused-imports";
9
+ import process from "node:process";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { getPackageInfoSync, isPackageExists } from "local-pkg";
12
12
  import globals from "globals";
@@ -246,10 +246,10 @@ function javascript(options = {}) {
246
246
  const { isInEditor: isInEditor$1 = false, overrides = {} } = options;
247
247
  return [{
248
248
  languageOptions: {
249
- ecmaVersion: 2022,
249
+ ecmaVersion: "latest",
250
250
  globals: {
251
251
  ...globals.browser,
252
- ...globals.es2021,
252
+ ...globals.es2026,
253
253
  ...globals.node,
254
254
  document: "readonly",
255
255
  navigator: "readonly",
@@ -257,7 +257,7 @@ function javascript(options = {}) {
257
257
  },
258
258
  parserOptions: {
259
259
  ecmaFeatures: { jsx: true },
260
- ecmaVersion: 2022,
260
+ ecmaVersion: "latest",
261
261
  sourceType: "module"
262
262
  },
263
263
  sourceType: "module"
@@ -602,13 +602,11 @@ function perfectionist() {
602
602
  type: "natural"
603
603
  }],
604
604
  "perfectionist/sort-named-exports": ["warn", {
605
- groupKind: "values-first",
606
- order: "asc",
605
+ groups: ["value-export", "type-export"],
607
606
  type: "natural"
608
607
  }],
609
608
  "perfectionist/sort-named-imports": ["warn", {
610
- groupKind: "values-first",
611
- order: "asc",
609
+ groups: ["value-import", "type-import"],
612
610
  type: "natural"
613
611
  }]
614
612
  }
@@ -639,6 +637,10 @@ async function pnpm() {
639
637
  name: "coderwyd/pnpm/pnpm-workspace-yaml",
640
638
  plugins: { pnpm: pluginPnpm },
641
639
  rules: {
640
+ "pnpm/yaml-enforce-settings": ["error", { settings: {
641
+ shellEmulator: true,
642
+ trustPolicy: "no-downgrade"
643
+ } }],
642
644
  "pnpm/yaml-no-duplicate-catalog-item": "error",
643
645
  "pnpm/yaml-no-unused-catalog-item": "error"
644
646
  }
@@ -878,6 +880,7 @@ function sortPackageJson() {
878
880
  "packageManager",
879
881
  "description",
880
882
  "author",
883
+ "contributors",
881
884
  "license",
882
885
  "funding",
883
886
  "homepage",
@@ -913,7 +916,9 @@ function sortPackageJson() {
913
916
  "simple-git-hooks",
914
917
  "lint-staged",
915
918
  "nano-staged",
916
- "eslintConfig"
919
+ "eslintConfig",
920
+ "prettier",
921
+ "tsdown"
917
922
  ],
918
923
  pathPattern: "^$"
919
924
  },
@@ -923,7 +928,7 @@ function sortPackageJson() {
923
928
  },
924
929
  {
925
930
  order: { type: "asc" },
926
- pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
931
+ pathPattern: String.raw`^(?:resolutions|overrides|pnpm\.overrides)$`
927
932
  },
928
933
  {
929
934
  order: [
@@ -1074,6 +1079,84 @@ function sortTsconfig() {
1074
1079
  ] }
1075
1080
  }];
1076
1081
  }
1082
+ function sortPnpmWorkspace() {
1083
+ return [{
1084
+ files: ["**/pnpm-workspace.yaml"],
1085
+ name: "coderwyd/sort/pnpm-workspace",
1086
+ rules: { "yaml/sort-keys": [
1087
+ "error",
1088
+ {
1089
+ order: [
1090
+ ...[
1091
+ "cacheDir",
1092
+ "catalogMode",
1093
+ "cleanupUnusedCatalogs",
1094
+ "dedupeDirectDeps",
1095
+ "deployAllFiles",
1096
+ "enablePrePostScripts",
1097
+ "engineStrict",
1098
+ "extendNodePath",
1099
+ "hoist",
1100
+ "hoistPattern",
1101
+ "hoistWorkspacePackages",
1102
+ "ignoreCompatibilityDb",
1103
+ "ignoreDepScripts",
1104
+ "ignoreScripts",
1105
+ "ignoreWorkspaceRootCheck",
1106
+ "managePackageManagerVersions",
1107
+ "minimumReleaseAge",
1108
+ "minimumReleaseAgeExclude",
1109
+ "modulesDir",
1110
+ "nodeLinker",
1111
+ "nodeVersion",
1112
+ "optimisticRepeatInstall",
1113
+ "packageManagerStrict",
1114
+ "packageManagerStrictVersion",
1115
+ "preferSymlinkedExecutables",
1116
+ "preferWorkspacePackages",
1117
+ "publicHoistPattern",
1118
+ "registrySupportsTimeField",
1119
+ "requiredScripts",
1120
+ "resolutionMode",
1121
+ "savePrefix",
1122
+ "scriptShell",
1123
+ "shamefullyHoist",
1124
+ "shellEmulator",
1125
+ "stateDir",
1126
+ "supportedArchitectures",
1127
+ "symlink",
1128
+ "tag",
1129
+ "trustPolicy",
1130
+ "trustPolicyExclude",
1131
+ "updateNotifier"
1132
+ ],
1133
+ "packages",
1134
+ "overrides",
1135
+ "patchedDependencies",
1136
+ "catalog",
1137
+ "catalogs",
1138
+ ...[
1139
+ "allowedDeprecatedVersions",
1140
+ "allowNonAppliedPatches",
1141
+ "configDependencies",
1142
+ "ignoredBuiltDependencies",
1143
+ "ignoredOptionalDependencies",
1144
+ "neverBuiltDependencies",
1145
+ "onlyBuiltDependencies",
1146
+ "onlyBuiltDependenciesFile",
1147
+ "packageExtensions",
1148
+ "peerDependencyRules"
1149
+ ]
1150
+ ],
1151
+ pathPattern: "^$"
1152
+ },
1153
+ {
1154
+ order: { type: "asc" },
1155
+ pathPattern: ".*"
1156
+ }
1157
+ ] }
1158
+ }];
1159
+ }
1077
1160
 
1078
1161
  //#endregion
1079
1162
  //#region src/configs/specials.ts
@@ -1745,7 +1828,7 @@ async function defineConfig(options = {}, ...userConfigs) {
1745
1828
  configs$1.push(ignores(options.ignores), javascript({
1746
1829
  isInEditor: isInEditor$1,
1747
1830
  overrides: getOverrides(options, "javascript")
1748
- }), comments(), node(), jsdoc(), imports(), unicorn(), command(), deMorgan(), perfectionist());
1831
+ }), comments(), node(), jsdoc(), imports(), unicorn(), command(), deMorgan(), perfectionist(), sortPnpmWorkspace());
1749
1832
  if (enableVue) componentExts.push("vue");
1750
1833
  if (enableTypeScript) configs$1.push(typescript({
1751
1834
  ...typescriptOptions,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "4.8.0",
4
+ "version": "4.9.1",
5
5
  "description": "Donny's ESLint config",
6
6
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
7
7
  "license": "MIT",
@@ -21,13 +21,13 @@
21
21
  "access": "public"
22
22
  },
23
23
  "exports": {
24
- ".": "./dist/index.js",
25
- "./cli": "./dist/cli.js",
24
+ ".": "./dist/index.mjs",
25
+ "./cli": "./dist/cli.mjs",
26
26
  "./package.json": "./package.json"
27
27
  },
28
- "main": "./dist/index.js",
29
- "module": "./dist/index.js",
30
- "types": "./dist/index.d.ts",
28
+ "main": "./dist/index.mjs",
29
+ "module": "./dist/index.mjs",
30
+ "types": "./dist/index.d.mts",
31
31
  "bin": "./bin/index.js",
32
32
  "files": [
33
33
  "bin",
@@ -75,58 +75,59 @@
75
75
  "dependencies": {
76
76
  "@antfu/install-pkg": "^1.1.0",
77
77
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
78
- "@typescript-eslint/eslint-plugin": "^8.46.2",
79
- "@typescript-eslint/parser": "^8.46.2",
80
- "@vitest/eslint-plugin": "^1.3.26",
78
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
79
+ "@typescript-eslint/parser": "^8.52.0",
80
+ "@vitest/eslint-plugin": "^1.6.5",
81
81
  "cac": "^6.7.14",
82
82
  "eslint-config-flat-gitignore": "^2.1.0",
83
83
  "eslint-config-prettier": "^10.1.8",
84
- "eslint-plugin-antfu": "^3.1.1",
85
- "eslint-plugin-command": "^3.3.1",
84
+ "eslint-plugin-antfu": "^3.1.3",
85
+ "eslint-plugin-command": "^3.4.0",
86
86
  "eslint-plugin-de-morgan": "^2.0.0",
87
- "eslint-plugin-import-lite": "^0.3.0",
88
- "eslint-plugin-jsdoc": "61.1.8",
87
+ "eslint-plugin-import-lite": "^0.5.0",
88
+ "eslint-plugin-jsdoc": "61.4.1",
89
89
  "eslint-plugin-jsonc": "^2.21.0",
90
90
  "eslint-plugin-n": "^17.23.1",
91
91
  "eslint-plugin-no-only-tests": "^3.3.0",
92
- "eslint-plugin-perfectionist": "^4.15.1",
93
- "eslint-plugin-pnpm": "^1.3.0",
92
+ "eslint-plugin-perfectionist": "^5.3.0",
93
+ "eslint-plugin-pnpm": "^1.4.3",
94
94
  "eslint-plugin-regexp": "^2.10.0",
95
95
  "eslint-plugin-unicorn": "^62.0.0",
96
96
  "eslint-plugin-unused-imports": "^4.3.0",
97
- "eslint-plugin-vue": "^10.5.1",
98
- "eslint-plugin-yml": "^1.19.0",
99
- "globals": "^16.4.0",
100
- "jsonc-eslint-parser": "^2.4.1",
97
+ "eslint-plugin-vue": "^10.6.2",
98
+ "eslint-plugin-yml": "^1.19.1",
99
+ "globals": "^17.0.0",
100
+ "jsonc-eslint-parser": "^2.4.2",
101
101
  "local-pkg": "^1.1.2",
102
102
  "parse-gitignore": "^2.0.0",
103
103
  "prompts": "^2.4.2",
104
104
  "vue-eslint-parser": "^10.2.0",
105
- "yaml-eslint-parser": "^1.3.0"
105
+ "yaml-eslint-parser": "^1.3.2"
106
106
  },
107
107
  "devDependencies": {
108
- "@eslint-react/eslint-plugin": "^2.2.4",
109
- "@eslint/config-inspector": "^1.3.0",
108
+ "@eslint-react/eslint-plugin": "^2.5.1",
109
+ "@eslint/config-inspector": "^1.4.2",
110
110
  "@types/eslint-config-prettier": "^6.11.3",
111
- "@types/node": "^24.9.2",
111
+ "@types/node": "^25.0.3",
112
112
  "@types/prompts": "^2.4.9",
113
- "@unocss/eslint-plugin": "^66.5.4",
114
- "bumpp": "^10.3.1",
115
- "eslint": "^9.38.0",
113
+ "@typescript/native-preview": "7.0.0-dev.20260107.1",
114
+ "@unocss/eslint-plugin": "^66.5.12",
115
+ "bumpp": "^10.3.2",
116
+ "eslint": "^9.39.2",
116
117
  "eslint-plugin-react-hooks": "7.0.1",
117
- "eslint-plugin-react-refresh": "^0.4.24",
118
- "eslint-plugin-svelte": "^3.12.5",
118
+ "eslint-plugin-react-refresh": "^0.4.26",
119
+ "eslint-plugin-svelte": "^3.13.1",
119
120
  "eslint-plugin-tailwindcss": "^3.18.2",
120
121
  "eslint-typegen": "^2.3.0",
121
122
  "jiti": "^2.6.1",
122
- "nano-staged": "^0.8.0",
123
- "prettier": "^3.6.2",
124
- "publint": "^0.3.15",
123
+ "nano-staged": "^0.9.0",
124
+ "prettier": "^3.7.4",
125
+ "publint": "^0.3.16",
125
126
  "simple-git-hooks": "^2.13.1",
126
- "svelte-eslint-parser": "^1.4.0",
127
- "tsdown": "^0.15.12",
127
+ "svelte-eslint-parser": "^1.4.1",
128
+ "tsdown": "^0.18.4",
128
129
  "typescript": "^5.9.3",
129
- "unplugin-unused": "^0.5.4"
130
+ "unplugin-unused": "^0.5.6"
130
131
  },
131
132
  "simple-git-hooks": {
132
133
  "pre-commit": "pnpm exec nano-staged"
@@ -142,6 +143,6 @@
142
143
  "build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
143
144
  "build:typegen": "jiti scripts/typegen.ts",
144
145
  "release": "bumpp",
145
- "typecheck": "tsc --noEmit"
146
+ "typecheck": "tsgo --noEmit"
146
147
  }
147
148
  }
File without changes