@cany748/eslint-config 4.1.0 → 4.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.
@@ -181,8 +181,7 @@ const parserPlain = {
181
181
  * Combine array and non-array configs into a single array.
182
182
  */
183
183
  async function combine(...configs$1) {
184
- const resolved = await Promise.all(configs$1);
185
- return resolved.flat();
184
+ return (await Promise.all(configs$1)).flat();
186
185
  }
187
186
  function toArray(value) {
188
187
  return Array.isArray(value) ? value : [value];
@@ -254,7 +253,12 @@ function formatters(options = true) {
254
253
  //#endregion
255
254
  //#region src/configs/ignores.ts
256
255
  function ignores(userIgnores = []) {
257
- return [{ ignores: [...GLOB_EXCLUDE, ...userIgnores] }];
256
+ let ignores$1 = [...GLOB_EXCLUDE];
257
+ ignores$1 = typeof userIgnores === "function" ? userIgnores(ignores$1) : [...ignores$1, ...userIgnores];
258
+ return [{
259
+ ignores: ignores$1,
260
+ name: "ignores"
261
+ }];
258
262
  }
259
263
 
260
264
  //#endregion
@@ -286,7 +290,7 @@ function javascript(options = {}) {
286
290
  const { isInEditor = false, overrides = {} } = options;
287
291
  return [{
288
292
  languageOptions: {
289
- ecmaVersion: 2022,
293
+ ecmaVersion: "latest",
290
294
  globals: {
291
295
  ...globals.browser,
292
296
  ...globals.es2021,
@@ -297,7 +301,7 @@ function javascript(options = {}) {
297
301
  },
298
302
  parserOptions: {
299
303
  ecmaFeatures: { jsx: true },
300
- ecmaVersion: 2022,
304
+ ecmaVersion: "latest",
301
305
  sourceType: "module"
302
306
  },
303
307
  sourceType: "module"
@@ -667,6 +671,14 @@ function sortPackageJson() {
667
671
  order: { type: "asc" },
668
672
  pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
669
673
  },
674
+ {
675
+ order: { type: "asc" },
676
+ pathPattern: String.raw`^workspaces\.catalog$`
677
+ },
678
+ {
679
+ order: { type: "asc" },
680
+ pathPattern: String.raw`^workspaces\.catalogs\.[^.]+$`
681
+ },
670
682
  {
671
683
  order: [
672
684
  "types",
@@ -986,9 +998,8 @@ function unicorn() {
986
998
  //#endregion
987
999
  //#region src/configs/unocss.ts
988
1000
  async function unocss() {
989
- const pluginUnoCSS = await interopDefault(import("@unocss/eslint-plugin"));
990
1001
  return [{
991
- ...pluginUnoCSS.configs.flat,
1002
+ ...(await interopDefault(import("@unocss/eslint-plugin"))).configs.flat,
992
1003
  name: "unocss"
993
1004
  }];
994
1005
  }
@@ -1117,7 +1128,7 @@ const VuePackages = [
1117
1128
  * The merged ESLint configurations.
1118
1129
  */
1119
1130
  const factoryConfig = function(options = {}, ...userConfigs) {
1120
- const { componentExts = [], formatters: enableFormatters = true, gitignore: enableGitignore = true, jsonc: enableJSONC = true, regexp: enableRegexp = true, test: enableTest = true, typescript: enableTypeScript = isPackageExists("typescript"), unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
1131
+ const { componentExts = [], formatters: enableFormatters = true, gitignore: enableGitignore = true, ignores: userIgnores = [], jsonc: enableJSONC = true, regexp: enableRegexp = true, test: enableTest = true, typescript: enableTypeScript = isPackageExists("typescript"), unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
1121
1132
  let isInEditor = options.isInEditor;
1122
1133
  if (isInEditor == null) {
1123
1134
  isInEditor = isInEditorEnv();
@@ -1126,7 +1137,7 @@ const factoryConfig = function(options = {}, ...userConfigs) {
1126
1137
  const configs$1 = [];
1127
1138
  if (enableGitignore) if (typeof enableGitignore === "boolean") configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
1128
1139
  else configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
1129
- configs$1.push(comments(), ignores(options.ignores), imports(), javascript({
1140
+ configs$1.push(comments(), ignores(userIgnores), imports(), javascript({
1130
1141
  isInEditor,
1131
1142
  overrides: options.javascript?.overrides
1132
1143
  }), node(), unicorn());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cany748/eslint-config",
3
3
  "type": "module",
4
- "version": "4.1.0",
4
+ "version": "4.2.0",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"
7
7
  },
@@ -11,9 +11,9 @@
11
11
  "dist"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@unocss/eslint-plugin": "^66.4.2",
15
- "eslint-plugin-vue": "^10.4.0",
16
- "typescript-eslint": "^8.40.0"
14
+ "@unocss/eslint-plugin": "^66.5.10",
15
+ "eslint-plugin-vue": "^10.6.2",
16
+ "typescript-eslint": "^8.49.0"
17
17
  },
18
18
  "peerDependenciesMeta": {
19
19
  "@unocss/eslint-plugin": {
@@ -28,36 +28,36 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
31
- "@vitest/eslint-plugin": "^1.3.4",
32
- "eslint": "^9.33.0",
31
+ "@vitest/eslint-plugin": "^1.5.2",
32
+ "eslint": "^9.39.2",
33
33
  "eslint-config-flat-gitignore": "^2.1.0",
34
34
  "eslint-config-prettier": "^10.1.8",
35
- "eslint-flat-config-utils": "^2.1.1",
35
+ "eslint-flat-config-utils": "^2.1.4",
36
36
  "eslint-plugin-import-x": "^4.16.1",
37
- "eslint-plugin-jsonc": "^2.20.1",
38
- "eslint-plugin-n": "^17.21.3",
37
+ "eslint-plugin-jsonc": "^2.21.0",
38
+ "eslint-plugin-n": "^17.23.1",
39
39
  "eslint-plugin-no-only-tests": "^3.3.0",
40
40
  "eslint-plugin-prettier": "^5.5.4",
41
41
  "eslint-plugin-regexp": "^2.10.0",
42
- "eslint-plugin-unicorn": "^60.0.0",
43
- "eslint-plugin-unused-imports": "^4.2.0",
44
- "globals": "^16.3.0",
45
- "jiti": "^2.5.1",
46
- "jsonc-eslint-parser": "^2.4.0",
42
+ "eslint-plugin-unicorn": "^62.0.0",
43
+ "eslint-plugin-unused-imports": "^4.3.0",
44
+ "globals": "^16.5.0",
45
+ "jiti": "^2.6.1",
46
+ "jsonc-eslint-parser": "^2.4.2",
47
47
  "local-pkg": "^1.1.2",
48
- "prettier": "^3.6.2"
48
+ "prettier": "^3.7.4"
49
49
  },
50
50
  "devDependencies": {
51
- "@types/node": "^24.3.0",
52
- "@unocss/eslint-plugin": "^66.4.2",
53
- "bumpp": "^10.2.3",
54
- "eslint-plugin-vue": "^10.4.0",
51
+ "@types/node": "^25.0.2",
52
+ "@unocss/eslint-plugin": "^66.5.10",
53
+ "bumpp": "^10.3.2",
54
+ "eslint-plugin-vue": "^10.6.2",
55
55
  "eslint-typegen": "^2.3.0",
56
- "lint-staged": "^16.1.5",
56
+ "lint-staged": "^16.2.7",
57
57
  "simple-git-hooks": "^2.13.1",
58
- "tsdown": "^0.14.1",
59
- "typescript": "^5.9.2",
60
- "typescript-eslint": "^8.40.0"
58
+ "tsdown": "^0.17.4",
59
+ "typescript": "^5.9.3",
60
+ "typescript-eslint": "^8.49.0"
61
61
  },
62
62
  "simple-git-hooks": {
63
63
  "pre-commit": "pnpm lint-staged"