@kirklin/eslint-config 2.7.0 → 2.8.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.
package/dist/cli.cjs CHANGED
@@ -41,7 +41,7 @@ var import_picocolors = __toESM(require("picocolors"), 1);
41
41
  var package_default = {
42
42
  name: "@kirklin/eslint-config",
43
43
  type: "module",
44
- version: "2.7.0",
44
+ version: "2.8.0",
45
45
  packageManager: "pnpm@9.12.3",
46
46
  description: "Kirk Lin's ESLint config",
47
47
  author: "Kirk Lin (https://github.com/kirklin/)",
@@ -91,7 +91,7 @@ var package_default = {
91
91
  "eslint-plugin-react-refresh": "^0.4.4",
92
92
  "eslint-plugin-solid": "^0.14.3",
93
93
  "eslint-plugin-svelte": ">=2.35.1",
94
- "prettier-plugin-astro": "^0.13.0",
94
+ "prettier-plugin-astro": "^0.14.0",
95
95
  "prettier-plugin-slidev": "^1.0.5",
96
96
  "svelte-eslint-parser": ">=0.37.0"
97
97
  },
@@ -137,35 +137,35 @@ var package_default = {
137
137
  }
138
138
  },
139
139
  dependencies: {
140
- "@antfu/install-pkg": "^0.4.1",
141
- "@clack/prompts": "^0.7.0",
140
+ "@antfu/install-pkg": "^0.5.0",
141
+ "@clack/prompts": "^0.8.2",
142
142
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
143
143
  "@eslint/markdown": "^6.2.1",
144
- "@stylistic/eslint-plugin": "^2.10.1",
145
- "@typescript-eslint/eslint-plugin": "^8.12.2",
146
- "@typescript-eslint/parser": "^8.12.2",
147
- "@vitest/eslint-plugin": "^1.1.7",
144
+ "@stylistic/eslint-plugin": "^2.11.0",
145
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
146
+ "@typescript-eslint/parser": "^8.16.0",
147
+ "@vitest/eslint-plugin": "^1.1.12",
148
148
  "eslint-config-flat-gitignore": "^0.3.0",
149
149
  "eslint-flat-config-utils": "^0.4.0",
150
150
  "eslint-merge-processors": "^0.1.0",
151
151
  "eslint-plugin-command": "^0.2.6",
152
- "eslint-plugin-import-x": "^4.4.0",
153
- "eslint-plugin-jsdoc": "^50.4.3",
154
- "eslint-plugin-jsonc": "^2.16.0",
152
+ "eslint-plugin-import-x": "^4.4.3",
153
+ "eslint-plugin-jsdoc": "^50.6.0",
154
+ "eslint-plugin-jsonc": "^2.18.2",
155
155
  "eslint-plugin-kirklin": "^1.5.0",
156
- "eslint-plugin-n": "^17.12.0",
156
+ "eslint-plugin-n": "^17.14.0",
157
157
  "eslint-plugin-no-only-tests": "^3.3.0",
158
- "eslint-plugin-perfectionist": "^3.9.1",
159
- "eslint-plugin-regexp": "^2.6.0",
158
+ "eslint-plugin-perfectionist": "^4.1.2",
159
+ "eslint-plugin-regexp": "^2.7.0",
160
160
  "eslint-plugin-toml": "^0.11.1",
161
- "eslint-plugin-unicorn": "^56.0.0",
161
+ "eslint-plugin-unicorn": "^56.0.1",
162
162
  "eslint-plugin-unused-imports": "^4.1.4",
163
- "eslint-plugin-vue": "^9.30.0",
163
+ "eslint-plugin-vue": "^9.31.0",
164
164
  "eslint-plugin-yml": "^1.15.0",
165
165
  "eslint-processor-vue-blocks": "^0.1.2",
166
- globals: "^15.11.0",
166
+ globals: "^15.12.0",
167
167
  "jsonc-eslint-parser": "^2.4.0",
168
- "local-pkg": "^0.5.0",
168
+ "local-pkg": "^0.5.1",
169
169
  "parse-gitignore": "^2.0.0",
170
170
  picocolors: "^1.1.1",
171
171
  "toml-eslint-parser": "^0.10.0",
@@ -174,25 +174,25 @@ var package_default = {
174
174
  yargs: "^17.7.2"
175
175
  },
176
176
  devDependencies: {
177
- "@antfu/ni": "^0.23.0",
178
- "@eslint-react/eslint-plugin": "^1.15.2",
177
+ "@antfu/ni": "^0.23.1",
178
+ "@eslint-react/eslint-plugin": "^1.17.1",
179
179
  "@eslint/config-inspector": "^0.5.6",
180
180
  "@kirklin/eslint-config": "workspace:*",
181
181
  "@prettier/plugin-xml": "^3.4.1",
182
- "@stylistic/eslint-plugin-migrate": "^2.10.1",
182
+ "@stylistic/eslint-plugin-migrate": "^2.11.0",
183
183
  "@types/fs-extra": "^11.0.4",
184
- "@types/node": "^22.8.6",
184
+ "@types/node": "^22.10.1",
185
185
  "@types/prompts": "^2.4.9",
186
186
  "@types/yargs": "^17.0.33",
187
- "@unocss/eslint-plugin": "^0.63.6",
188
- "astro-eslint-parser": "^1.0.3",
189
- bumpp: "^9.8.0",
190
- eslint: "^9.14.0",
191
- "eslint-plugin-astro": "^1.3.0",
187
+ "@unocss/eslint-plugin": "^0.64.1",
188
+ "astro-eslint-parser": "^1.1.0",
189
+ bumpp: "^9.8.1",
190
+ eslint: "^9.15.0",
191
+ "eslint-plugin-astro": "^1.3.1",
192
192
  "eslint-plugin-format": "^0.1.2",
193
193
  "eslint-plugin-react-hooks": "^5.0.0",
194
194
  "eslint-plugin-react-refresh": "^0.4.14",
195
- "eslint-plugin-solid": "^0.14.3",
195
+ "eslint-plugin-solid": "^0.14.4",
196
196
  "eslint-plugin-svelte": "^2.46.0",
197
197
  "eslint-typegen": "^0.3.2",
198
198
  esno: "^4.8.0",
@@ -205,18 +205,18 @@ var package_default = {
205
205
  "prettier-plugin-slidev": "^1.0.5",
206
206
  rimraf: "^6.0.1",
207
207
  "simple-git-hooks": "^2.11.1",
208
- svelte: "^5.1.9",
208
+ svelte: "^5.2.10",
209
209
  "svelte-eslint-parser": "^0.43.0",
210
210
  tsup: "^8.3.5",
211
211
  tsx: "^4.19.2",
212
- typescript: "^5.6.3",
213
- vitest: "^2.1.4",
214
- vue: "^3.5.12"
212
+ typescript: "^5.7.2",
213
+ vitest: "^2.1.6",
214
+ vue: "^3.5.13"
215
215
  },
216
216
  resolutions: {
217
217
  "@eslint-community/eslint-utils": "^4.4.1",
218
- "@typescript-eslint/utils": "^8.12.2",
219
- eslint: "^9.14.0",
218
+ "@typescript-eslint/utils": "^8.16.0",
219
+ eslint: "^9.15.0",
220
220
  tsx: "^4.19.2"
221
221
  },
222
222
  "simple-git-hooks": {
@@ -594,7 +594,7 @@ async function run(options = {}) {
594
594
  await updateEslintFiles(result);
595
595
  await updateVscodeSettings(result);
596
596
  p4.log.success(import_picocolors5.default.green(`Setup completed`));
597
- p4.outro(`Now you can update the dependencies and run ${import_picocolors5.default.blue("eslint . --fix")}
597
+ p4.outro(`Now you can update the dependencies by run ${import_picocolors5.default.blue("pnpm install")} and run ${import_picocolors5.default.blue("eslint . --fix")}
598
598
  `);
599
599
  }
600
600
 
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import c from "picocolors";
12
12
  var package_default = {
13
13
  name: "@kirklin/eslint-config",
14
14
  type: "module",
15
- version: "2.7.0",
15
+ version: "2.8.0",
16
16
  packageManager: "pnpm@9.12.3",
17
17
  description: "Kirk Lin's ESLint config",
18
18
  author: "Kirk Lin (https://github.com/kirklin/)",
@@ -62,7 +62,7 @@ var package_default = {
62
62
  "eslint-plugin-react-refresh": "^0.4.4",
63
63
  "eslint-plugin-solid": "^0.14.3",
64
64
  "eslint-plugin-svelte": ">=2.35.1",
65
- "prettier-plugin-astro": "^0.13.0",
65
+ "prettier-plugin-astro": "^0.14.0",
66
66
  "prettier-plugin-slidev": "^1.0.5",
67
67
  "svelte-eslint-parser": ">=0.37.0"
68
68
  },
@@ -108,35 +108,35 @@ var package_default = {
108
108
  }
109
109
  },
110
110
  dependencies: {
111
- "@antfu/install-pkg": "^0.4.1",
112
- "@clack/prompts": "^0.7.0",
111
+ "@antfu/install-pkg": "^0.5.0",
112
+ "@clack/prompts": "^0.8.2",
113
113
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
114
114
  "@eslint/markdown": "^6.2.1",
115
- "@stylistic/eslint-plugin": "^2.10.1",
116
- "@typescript-eslint/eslint-plugin": "^8.12.2",
117
- "@typescript-eslint/parser": "^8.12.2",
118
- "@vitest/eslint-plugin": "^1.1.7",
115
+ "@stylistic/eslint-plugin": "^2.11.0",
116
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
117
+ "@typescript-eslint/parser": "^8.16.0",
118
+ "@vitest/eslint-plugin": "^1.1.12",
119
119
  "eslint-config-flat-gitignore": "^0.3.0",
120
120
  "eslint-flat-config-utils": "^0.4.0",
121
121
  "eslint-merge-processors": "^0.1.0",
122
122
  "eslint-plugin-command": "^0.2.6",
123
- "eslint-plugin-import-x": "^4.4.0",
124
- "eslint-plugin-jsdoc": "^50.4.3",
125
- "eslint-plugin-jsonc": "^2.16.0",
123
+ "eslint-plugin-import-x": "^4.4.3",
124
+ "eslint-plugin-jsdoc": "^50.6.0",
125
+ "eslint-plugin-jsonc": "^2.18.2",
126
126
  "eslint-plugin-kirklin": "^1.5.0",
127
- "eslint-plugin-n": "^17.12.0",
127
+ "eslint-plugin-n": "^17.14.0",
128
128
  "eslint-plugin-no-only-tests": "^3.3.0",
129
- "eslint-plugin-perfectionist": "^3.9.1",
130
- "eslint-plugin-regexp": "^2.6.0",
129
+ "eslint-plugin-perfectionist": "^4.1.2",
130
+ "eslint-plugin-regexp": "^2.7.0",
131
131
  "eslint-plugin-toml": "^0.11.1",
132
- "eslint-plugin-unicorn": "^56.0.0",
132
+ "eslint-plugin-unicorn": "^56.0.1",
133
133
  "eslint-plugin-unused-imports": "^4.1.4",
134
- "eslint-plugin-vue": "^9.30.0",
134
+ "eslint-plugin-vue": "^9.31.0",
135
135
  "eslint-plugin-yml": "^1.15.0",
136
136
  "eslint-processor-vue-blocks": "^0.1.2",
137
- globals: "^15.11.0",
137
+ globals: "^15.12.0",
138
138
  "jsonc-eslint-parser": "^2.4.0",
139
- "local-pkg": "^0.5.0",
139
+ "local-pkg": "^0.5.1",
140
140
  "parse-gitignore": "^2.0.0",
141
141
  picocolors: "^1.1.1",
142
142
  "toml-eslint-parser": "^0.10.0",
@@ -145,25 +145,25 @@ var package_default = {
145
145
  yargs: "^17.7.2"
146
146
  },
147
147
  devDependencies: {
148
- "@antfu/ni": "^0.23.0",
149
- "@eslint-react/eslint-plugin": "^1.15.2",
148
+ "@antfu/ni": "^0.23.1",
149
+ "@eslint-react/eslint-plugin": "^1.17.1",
150
150
  "@eslint/config-inspector": "^0.5.6",
151
151
  "@kirklin/eslint-config": "workspace:*",
152
152
  "@prettier/plugin-xml": "^3.4.1",
153
- "@stylistic/eslint-plugin-migrate": "^2.10.1",
153
+ "@stylistic/eslint-plugin-migrate": "^2.11.0",
154
154
  "@types/fs-extra": "^11.0.4",
155
- "@types/node": "^22.8.6",
155
+ "@types/node": "^22.10.1",
156
156
  "@types/prompts": "^2.4.9",
157
157
  "@types/yargs": "^17.0.33",
158
- "@unocss/eslint-plugin": "^0.63.6",
159
- "astro-eslint-parser": "^1.0.3",
160
- bumpp: "^9.8.0",
161
- eslint: "^9.14.0",
162
- "eslint-plugin-astro": "^1.3.0",
158
+ "@unocss/eslint-plugin": "^0.64.1",
159
+ "astro-eslint-parser": "^1.1.0",
160
+ bumpp: "^9.8.1",
161
+ eslint: "^9.15.0",
162
+ "eslint-plugin-astro": "^1.3.1",
163
163
  "eslint-plugin-format": "^0.1.2",
164
164
  "eslint-plugin-react-hooks": "^5.0.0",
165
165
  "eslint-plugin-react-refresh": "^0.4.14",
166
- "eslint-plugin-solid": "^0.14.3",
166
+ "eslint-plugin-solid": "^0.14.4",
167
167
  "eslint-plugin-svelte": "^2.46.0",
168
168
  "eslint-typegen": "^0.3.2",
169
169
  esno: "^4.8.0",
@@ -176,18 +176,18 @@ var package_default = {
176
176
  "prettier-plugin-slidev": "^1.0.5",
177
177
  rimraf: "^6.0.1",
178
178
  "simple-git-hooks": "^2.11.1",
179
- svelte: "^5.1.9",
179
+ svelte: "^5.2.10",
180
180
  "svelte-eslint-parser": "^0.43.0",
181
181
  tsup: "^8.3.5",
182
182
  tsx: "^4.19.2",
183
- typescript: "^5.6.3",
184
- vitest: "^2.1.4",
185
- vue: "^3.5.12"
183
+ typescript: "^5.7.2",
184
+ vitest: "^2.1.6",
185
+ vue: "^3.5.13"
186
186
  },
187
187
  resolutions: {
188
188
  "@eslint-community/eslint-utils": "^4.4.1",
189
- "@typescript-eslint/utils": "^8.12.2",
190
- eslint: "^9.14.0",
189
+ "@typescript-eslint/utils": "^8.16.0",
190
+ eslint: "^9.15.0",
191
191
  tsx: "^4.19.2"
192
192
  },
193
193
  "simple-git-hooks": {
@@ -565,7 +565,7 @@ async function run(options = {}) {
565
565
  await updateEslintFiles(result);
566
566
  await updateVscodeSettings(result);
567
567
  p4.log.success(c5.green(`Setup completed`));
568
- p4.outro(`Now you can update the dependencies and run ${c5.blue("eslint . --fix")}
568
+ p4.outro(`Now you can update the dependencies by run ${c5.blue("pnpm install")} and run ${c5.blue("eslint . --fix")}
569
569
  `);
570
570
  }
571
571
 
package/dist/index.cjs CHANGED
@@ -107,7 +107,7 @@ __export(src_exports, {
107
107
  });
108
108
  module.exports = __toCommonJS(src_exports);
109
109
 
110
- // node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
110
+ // node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
111
111
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
112
112
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
113
113
 
@@ -344,6 +344,9 @@ async function astro(options = {}) {
344
344
  "astro/no-unused-define-vars-in-style": "error",
345
345
  "astro/semi": "off",
346
346
  "astro/valid-compile": "error",
347
+ // Astro uses top level await for e.g. data fetching
348
+ // https://docs.astro.build/en/guides/data-fetching/#fetch-in-astro
349
+ "kirklin/no-top-level-await": "off",
347
350
  ...stylistic2 ? {
348
351
  "style/indent": "off",
349
352
  "style/jsx-closing-tag-location": "off",
@@ -1281,10 +1284,10 @@ async function perfectionist() {
1281
1284
  "perfectionist/sort-imports": ["error", {
1282
1285
  groups: [
1283
1286
  "type",
1284
- ["parent-type", "sibling-type", "index-type"],
1287
+ ["parent-type", "sibling-type", "index-type", "internal-type"],
1285
1288
  "builtin",
1286
1289
  "external",
1287
- ["internal", "internal-type"],
1290
+ "internal",
1288
1291
  ["parent", "sibling", "index"],
1289
1292
  "side-effect",
1290
1293
  "object",
@@ -1318,25 +1321,31 @@ var NextJsPackages = [
1318
1321
  async function react(options = {}) {
1319
1322
  const {
1320
1323
  files = [GLOB_SRC],
1321
- overrides = {}
1324
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1325
+ ignoresTypeAware = [
1326
+ `${GLOB_MARKDOWN}/**`,
1327
+ GLOB_ASTRO_TS
1328
+ ],
1329
+ overrides = {},
1330
+ tsconfigPath
1322
1331
  } = options;
1323
1332
  await ensurePackages([
1324
1333
  "@eslint-react/eslint-plugin",
1325
1334
  "eslint-plugin-react-hooks",
1326
1335
  "eslint-plugin-react-refresh"
1327
1336
  ]);
1328
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1329
1337
  const isTypeAware = !!tsconfigPath;
1338
+ const typeAwareRules = {
1339
+ "react/no-leaked-conditional-rendering": "warn"
1340
+ };
1330
1341
  const [
1331
1342
  pluginReact,
1332
1343
  pluginReactHooks,
1333
- pluginReactRefresh,
1334
- parserTs
1344
+ pluginReactRefresh
1335
1345
  ] = await Promise.all([
1336
1346
  interopDefault(import("@eslint-react/eslint-plugin")),
1337
1347
  interopDefault(import("eslint-plugin-react-hooks")),
1338
- interopDefault(import("eslint-plugin-react-refresh")),
1339
- interopDefault(import("@typescript-eslint/parser"))
1348
+ interopDefault(import("eslint-plugin-react-refresh"))
1340
1349
  ]);
1341
1350
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
1342
1351
  const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
@@ -1357,12 +1366,10 @@ async function react(options = {}) {
1357
1366
  {
1358
1367
  files,
1359
1368
  languageOptions: {
1360
- parser: parserTs,
1361
1369
  parserOptions: {
1362
1370
  ecmaFeatures: {
1363
1371
  jsx: true
1364
- },
1365
- ...isTypeAware ? { project: tsconfigPath } : {}
1372
+ }
1366
1373
  },
1367
1374
  sourceType: "module"
1368
1375
  },
@@ -1451,13 +1458,18 @@ async function react(options = {}) {
1451
1458
  "react/prefer-destructuring-assignment": "warn",
1452
1459
  "react/prefer-shorthand-boolean": "warn",
1453
1460
  "react/prefer-shorthand-fragment": "warn",
1454
- ...isTypeAware ? {
1455
- "react/no-leaked-conditional-rendering": "warn"
1456
- } : {},
1457
1461
  // overrides
1458
1462
  ...overrides
1459
1463
  }
1460
- }
1464
+ },
1465
+ ...isTypeAware ? [{
1466
+ files: filesTypeAware,
1467
+ ignores: ignoresTypeAware,
1468
+ name: "kirklin/react/type-aware-rules",
1469
+ rules: {
1470
+ ...typeAwareRules
1471
+ }
1472
+ }] : []
1461
1473
  ];
1462
1474
  }
1463
1475
 
@@ -1879,7 +1891,7 @@ async function svelte(options = {}) {
1879
1891
  // superseded by svelte/no-trailing-spaces
1880
1892
  "svelte/derived-has-same-inputs-outputs": "error",
1881
1893
  "svelte/html-closing-bracket-spacing": "error",
1882
- "svelte/html-quotes": ["error", { prefer: "double" }],
1894
+ "svelte/html-quotes": ["error", { prefer: quotes === "backtick" ? "double" : quotes }],
1883
1895
  "svelte/indent": ["error", { alignAttributesVertically: true, indent }],
1884
1896
  "svelte/mustache-spacing": "error",
1885
1897
  "svelte/no-spaces-around-equal-signs-in-attribute": "error",
@@ -2449,7 +2461,7 @@ async function yaml(options = {}) {
2449
2461
  "yaml/indent": ["error", indent === "tab" ? 2 : indent],
2450
2462
  "yaml/key-spacing": "error",
2451
2463
  "yaml/no-tab-indent": "error",
2452
- "yaml/quotes": ["error", { avoidEscape: false, prefer: "double" }],
2464
+ "yaml/quotes": ["error", { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
2453
2465
  "yaml/spaced-comment": "error"
2454
2466
  } : {},
2455
2467
  ...overrides