@dhzh/eslint-config 0.1.2 → 0.1.3

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.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // src/factory.ts
2
- import process3 from "process";
3
- import fs from "fs";
2
+ import process3 from "node:process";
3
+ import fs from "node:fs";
4
4
  import { isPackageExists as isPackageExists4 } from "local-pkg";
5
+ import { FlatConfigPipeline } from "eslint-flat-config-utils";
5
6
 
6
7
  // src/plugins.ts
7
8
  import { default as default2 } from "eslint-plugin-antfu";
@@ -53,6 +54,7 @@ var GLOB_YAML = "**/*.y?(a)ml";
53
54
  var GLOB_TOML = "**/*.toml";
54
55
  var GLOB_HTML = "**/*.htm?(l)";
55
56
  var GLOB_ASTRO = "**/*.astro";
57
+ var GLOB_GRAPHQL = "**/*.{g,graph}ql";
56
58
  var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
57
59
  var GLOB_TESTS = [
58
60
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
@@ -369,7 +371,7 @@ async function javascript(options = {}) {
369
371
  }
370
372
 
371
373
  // src/utils.ts
372
- import process from "process";
374
+ import process from "node:process";
373
375
  import { isPackageExists } from "local-pkg";
374
376
  var parserPlain = {
375
377
  meta: {
@@ -934,7 +936,7 @@ async function formatters(options = {}, stylistic2 = {}) {
934
936
  }
935
937
  if (options.graphql) {
936
938
  configs.push({
937
- files: ["**/*.graphql"],
939
+ files: [GLOB_GRAPHQL],
938
940
  languageOptions: {
939
941
  parser: parserPlain
940
942
  },
@@ -1418,7 +1420,7 @@ async function test(options = {}) {
1418
1420
  }
1419
1421
 
1420
1422
  // src/configs/typescript.ts
1421
- import process2 from "process";
1423
+ import process2 from "node:process";
1422
1424
  async function typescript(options = {}) {
1423
1425
  const {
1424
1426
  componentExts = [],
@@ -2004,7 +2006,7 @@ var defaultPluginRenaming = {
2004
2006
  "vitest": "test",
2005
2007
  "yml": "yaml"
2006
2008
  };
2007
- async function dhzh(options = {}, ...userConfigs) {
2009
+ function dhzh(options = {}, ...userConfigs) {
2008
2010
  const {
2009
2011
  astro: enableAstro = false,
2010
2012
  autoRenamePlugins = true,
@@ -2146,13 +2148,15 @@ async function dhzh(options = {}, ...userConfigs) {
2146
2148
  }, {});
2147
2149
  if (Object.keys(fusedConfig).length)
2148
2150
  configs.push([fusedConfig]);
2149
- const merged = await combine(
2151
+ let pipeline = new FlatConfigPipeline();
2152
+ pipeline = pipeline.append(
2150
2153
  ...configs,
2151
2154
  ...userConfigs
2152
2155
  );
2153
- if (autoRenamePlugins)
2154
- return renamePluginInConfigs(merged, defaultPluginRenaming);
2155
- return merged;
2156
+ if (autoRenamePlugins) {
2157
+ pipeline = pipeline.renamePlugins(defaultPluginRenaming);
2158
+ }
2159
+ return pipeline;
2156
2160
  }
2157
2161
  function resolveSubOptions(options, key) {
2158
2162
  return typeof options[key] === "boolean" ? {} : options[key] || {};
@@ -2172,6 +2176,7 @@ export {
2172
2176
  GLOB_ASTRO,
2173
2177
  GLOB_CSS,
2174
2178
  GLOB_EXCLUDE,
2179
+ GLOB_GRAPHQL,
2175
2180
  GLOB_HTML,
2176
2181
  GLOB_JS,
2177
2182
  GLOB_JSON,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dhzh/eslint-config",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "packageManager": "pnpm@8.15.4",
6
6
  "description": "Easton's ESLint config",
7
7
  "author": "Easton Zheng <dhzhme@gmail.com>",
@@ -29,7 +29,7 @@
29
29
  "eslint": ">=8.40.0",
30
30
  "eslint-plugin-astro": "^0.31.4",
31
31
  "eslint-plugin-format": ">=0.1.0",
32
- "eslint-plugin-svelte": "^2.34.1",
32
+ "eslint-plugin-svelte": "^2.35.1",
33
33
  "prettier-plugin-astro": "^0.13.0",
34
34
  "prettier-plugin-slidev": "^1.0.5",
35
35
  "svelte-eslint-parser": "^0.33.1"
@@ -61,22 +61,19 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@antfu/eslint-define-config": "^1.23.0-2",
65
- "@antfu/install-pkg": "^0.3.1",
64
+ "@antfu/install-pkg": "^0.3.2",
66
65
  "@clack/prompts": "^0.7.0",
67
- "@eslint-types/jsdoc": "46.8.2-1",
68
- "@eslint-types/typescript-eslint": "^7.0.2",
69
- "@eslint-types/unicorn": "^51.0.1",
70
66
  "@stylistic/eslint-plugin": "^1.7.0",
71
- "@typescript-eslint/eslint-plugin": "^7.2.0",
72
- "@typescript-eslint/parser": "^7.2.0",
67
+ "@typescript-eslint/eslint-plugin": "^7.4.0",
68
+ "@typescript-eslint/parser": "^7.4.0",
73
69
  "eslint-config-flat-gitignore": "^0.1.3",
70
+ "eslint-flat-config-utils": "^0.1.1",
74
71
  "eslint-merge-processors": "^0.1.0",
75
72
  "eslint-plugin-antfu": "^2.1.2",
76
73
  "eslint-plugin-eslint-comments": "^3.2.0",
77
- "eslint-plugin-import-x": "^0.4.1",
74
+ "eslint-plugin-import-x": "^0.4.4",
78
75
  "eslint-plugin-jsdoc": "^48.2.1",
79
- "eslint-plugin-jsonc": "^2.13.0",
76
+ "eslint-plugin-jsonc": "^2.14.1",
80
77
  "eslint-plugin-markdown": "^4.0.1",
81
78
  "eslint-plugin-n": "^16.6.2",
82
79
  "eslint-plugin-no-only-tests": "^3.1.0",
@@ -87,11 +84,11 @@
87
84
  "eslint-plugin-toml": "^0.9.2",
88
85
  "eslint-plugin-unicorn": "^51.0.1",
89
86
  "eslint-plugin-unused-imports": "^3.1.0",
90
- "eslint-plugin-vitest": "^0.3.26",
91
- "eslint-plugin-vue": "^9.23.0",
92
- "eslint-plugin-yml": "^1.12.2",
87
+ "eslint-plugin-vitest": "^0.4.0",
88
+ "eslint-plugin-vue": "^9.24.0",
89
+ "eslint-plugin-yml": "^1.13.2",
93
90
  "eslint-processor-vue-blocks": "^0.1.1",
94
- "globals": "^14.0.0",
91
+ "globals": "^15.0.0",
95
92
  "jsonc-eslint-parser": "^2.4.0",
96
93
  "local-pkg": "^0.5.0",
97
94
  "parse-gitignore": "^2.0.0",
@@ -105,20 +102,20 @@
105
102
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
106
103
  "@antfu/ni": "^0.21.12",
107
104
  "@stylistic/eslint-plugin-migrate": "^1.7.0",
108
- "@types/eslint": "^8.56.5",
105
+ "@types/eslint": "^8.56.6",
109
106
  "@types/fs-extra": "^11.0.4",
110
- "@types/node": "^20.11.27",
107
+ "@types/node": "^20.11.30",
111
108
  "@types/prompts": "^2.4.9",
112
109
  "@types/yargs": "^17.0.32",
113
- "@unocss/eslint-plugin": "^0.58.5",
110
+ "@unocss/eslint-plugin": "^0.58.7",
114
111
  "astro-eslint-parser": "^0.16.3",
115
112
  "bumpp": "^9.4.0",
116
- "eslint": "npm:eslint-ts-patch@^8.57.0-0",
117
- "eslint-flat-config-viewer": "^0.1.11",
118
- "eslint-plugin-astro": "^0.31.4",
113
+ "eslint": "9.0.0-rc.0",
114
+ "eslint-flat-config-viewer": "^0.1.14",
115
+ "eslint-plugin-astro": "^0.33.1",
119
116
  "eslint-plugin-format": "^0.1.0",
120
- "eslint-plugin-svelte": "^2.35.1",
121
- "eslint-ts-patch": "^8.57.0-0",
117
+ "eslint-plugin-svelte": "2.36.0-next.13",
118
+ "eslint-typegen": "^0.1.4",
122
119
  "esno": "^4.7.0",
123
120
  "execa": "^8.0.1",
124
121
  "fast-glob": "^3.3.2",
@@ -127,14 +124,14 @@
127
124
  "prettier-plugin-astro": "^0.13.0",
128
125
  "prettier-plugin-slidev": "^1.0.5",
129
126
  "rimraf": "^5.0.5",
130
- "simple-git-hooks": "^2.10.0",
127
+ "simple-git-hooks": "^2.11.1",
131
128
  "svelte": "^4.2.12",
132
129
  "svelte-eslint-parser": "^0.33.1",
133
130
  "tsup": "^8.0.2",
134
- "typescript": "^5.4.2",
135
- "vitest": "^1.3.1",
131
+ "typescript": "^5.4.3",
132
+ "vitest": "^1.4.0",
136
133
  "vue": "^3.4.21",
137
- "@dhzh/eslint-config": "0.1.2"
134
+ "@dhzh/eslint-config": "0.1.3"
138
135
  },
139
136
  "simple-git-hooks": {
140
137
  "pre-commit": "pnpm lint-staged"
@@ -143,11 +140,12 @@
143
140
  "*": "eslint --fix"
144
141
  },
145
142
  "scripts": {
146
- "build": "tsup --format esm,cjs --clean --dts",
143
+ "build": "nr typegen && tsup --format esm,cjs --clean --dts",
147
144
  "stub": "tsup --format esm",
148
145
  "dev": "tsup --format esm,cjs --watch & eslint-flat-config-viewer",
149
146
  "watch": "tsup --format esm,cjs --watch",
150
147
  "lint": "eslint .",
148
+ "typegen": "esno scripts/typegen.ts",
151
149
  "release": "bumpp && pnpm publish --access=public",
152
150
  "test": "vitest",
153
151
  "typecheck": "tsc --noEmit"