@luxass/eslint-config 4.4.3 → 4.5.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/index.js CHANGED
@@ -447,8 +447,8 @@ var parserPlain = {
447
447
  }
448
448
  })
449
449
  };
450
- async function combine(...configs) {
451
- const resolved = await Promise.all(configs);
450
+ async function combine(...configs2) {
451
+ const resolved = await Promise.all(configs2);
452
452
  return resolved.flat();
453
453
  }
454
454
  function renameRules(rules, from, to) {
@@ -1638,11 +1638,13 @@ async function test(options = {}) {
1638
1638
  name: "luxass/test/rules",
1639
1639
  files,
1640
1640
  rules: {
1641
+ "node/prefer-global/process": "off",
1641
1642
  "test/consistent-test-it": [
1642
1643
  "error",
1643
1644
  { fn: "it", withinDescribe: "it" }
1644
1645
  ],
1645
1646
  "test/no-identical-title": "error",
1647
+ "test/no-import-node-test": "error",
1646
1648
  "test/no-focused-tests": editor ? "off" : "error",
1647
1649
  "test/prefer-hooks-in-order": "error",
1648
1650
  "test/prefer-lowercase-title": "error",
@@ -1705,7 +1707,7 @@ var RemixPackages = [
1705
1707
  ];
1706
1708
  async function react(options = {}) {
1707
1709
  const {
1708
- files = [GLOB_TS, GLOB_TSX],
1710
+ files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
1709
1711
  overrides = {}
1710
1712
  } = options;
1711
1713
  await ensure([
@@ -2034,7 +2036,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2034
2036
  options.dprintOptions || {}
2035
2037
  );
2036
2038
  const pluginFormat = await interop(import("eslint-plugin-format"));
2037
- const configs = [
2039
+ const configs2 = [
2038
2040
  {
2039
2041
  name: "luxass/formatter/setup",
2040
2042
  plugins: {
@@ -2043,7 +2045,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2043
2045
  }
2044
2046
  ];
2045
2047
  if (options.css) {
2046
- configs.push(
2048
+ configs2.push(
2047
2049
  {
2048
2050
  name: "luxass/formatter/css",
2049
2051
  files: [GLOB_CSS, GLOB_POSTCSS],
@@ -2095,7 +2097,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2095
2097
  );
2096
2098
  }
2097
2099
  if (options.html) {
2098
- configs.push({
2100
+ configs2.push({
2099
2101
  name: "luxass/formatter/html",
2100
2102
  files: [GLOB_HTML],
2101
2103
  languageOptions: {
@@ -2114,7 +2116,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2114
2116
  }
2115
2117
  if (options.markdown) {
2116
2118
  const formater = options.markdown === true ? "prettier" : options.markdown;
2117
- configs.push({
2119
+ configs2.push({
2118
2120
  name: "luxass/formatter/markdown",
2119
2121
  files: [GLOB_MARKDOWN],
2120
2122
  languageOptions: {
@@ -2137,7 +2139,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2137
2139
  });
2138
2140
  }
2139
2141
  if (options.astro) {
2140
- configs.push({
2142
+ configs2.push({
2141
2143
  name: "luxass/formatter/astro",
2142
2144
  files: [GLOB_ASTRO],
2143
2145
  languageOptions: {
@@ -2158,7 +2160,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2158
2160
  });
2159
2161
  }
2160
2162
  if (options.graphql) {
2161
- configs.push({
2163
+ configs2.push({
2162
2164
  name: "luxass/formatter/graphql",
2163
2165
  files: [GLOB_GRAPHQL],
2164
2166
  languageOptions: {
@@ -2175,7 +2177,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2175
2177
  }
2176
2178
  });
2177
2179
  }
2178
- return configs;
2180
+ return configs2;
2179
2181
  }
2180
2182
 
2181
2183
  // src/configs/toml.ts
@@ -2314,6 +2316,32 @@ async function solid(options = {}) {
2314
2316
  ];
2315
2317
  }
2316
2318
 
2319
+ // src/configs/regexp.ts
2320
+ import { configs } from "eslint-plugin-regexp";
2321
+ async function regexp(options = {}) {
2322
+ const config = configs["flat/recommended"];
2323
+ const rules = {
2324
+ ...config.rules
2325
+ };
2326
+ if (options.level === "warn") {
2327
+ for (const key in rules) {
2328
+ if (rules[key] === "error") {
2329
+ rules[key] = "warn";
2330
+ }
2331
+ }
2332
+ }
2333
+ return [
2334
+ {
2335
+ ...config,
2336
+ name: "luxass/regexp/rules",
2337
+ rules: {
2338
+ ...rules,
2339
+ ...options.overrides
2340
+ }
2341
+ }
2342
+ ];
2343
+ }
2344
+
2317
2345
  // src/factory.ts
2318
2346
  var FLAT_CONFIG_PROPS = [
2319
2347
  "name",
@@ -2357,23 +2385,24 @@ function luxass(options = {}, ...userConfigs) {
2357
2385
  solid: enableSolid = false,
2358
2386
  typescript: enableTypeScript = isPackageExists4("typescript"),
2359
2387
  unocss: enableUnoCSS = false,
2388
+ regexp: enableRegexp = true,
2360
2389
  vue: enableVue = VuePackages.some((i) => isPackageExists4(i))
2361
2390
  } = options;
2362
2391
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
2363
2392
  if (stylisticOptions && !("jsx" in stylisticOptions)) {
2364
2393
  stylisticOptions.jsx = options.jsx ?? true;
2365
2394
  }
2366
- const configs = [];
2395
+ const configs2 = [];
2367
2396
  if (enableGitignore) {
2368
2397
  if (typeof enableGitignore !== "boolean") {
2369
- configs.push(interop(import("eslint-config-flat-gitignore")).then((plugin) => [plugin(enableGitignore)]));
2398
+ configs2.push(interop(import("eslint-config-flat-gitignore")).then((plugin) => [plugin(enableGitignore)]));
2370
2399
  } else {
2371
2400
  if (existsSync(".gitignore")) {
2372
- configs.push(interop(import("eslint-config-flat-gitignore")).then((plugin) => [plugin()]));
2401
+ configs2.push(interop(import("eslint-config-flat-gitignore")).then((plugin) => [plugin()]));
2373
2402
  }
2374
2403
  }
2375
2404
  }
2376
- configs.push(
2405
+ configs2.push(
2377
2406
  ignores(),
2378
2407
  javascript({
2379
2408
  editor,
@@ -2393,33 +2422,39 @@ function luxass(options = {}, ...userConfigs) {
2393
2422
  exts.push("vue");
2394
2423
  }
2395
2424
  if (enableTypeScript) {
2396
- configs.push(typescript({
2425
+ configs2.push(typescript({
2397
2426
  ...resolveSubOptions(options, "typescript"),
2398
2427
  exts,
2399
2428
  overrides: getOverrides(options, "typescript")
2400
2429
  }));
2401
2430
  }
2402
2431
  if (stylisticOptions) {
2403
- configs.push(stylistic({
2432
+ configs2.push(stylistic({
2404
2433
  ...stylisticOptions,
2405
2434
  overrides: getOverrides(options, "stylistic")
2406
2435
  }));
2407
2436
  }
2437
+ if (enableRegexp) {
2438
+ configs2.push(regexp({
2439
+ ...resolveSubOptions(options, "regexp"),
2440
+ overrides: getOverrides(options, "regexp")
2441
+ }));
2442
+ }
2408
2443
  if (options.test ?? true) {
2409
- configs.push(test({
2444
+ configs2.push(test({
2410
2445
  editor,
2411
2446
  overrides: getOverrides(options, "test")
2412
2447
  }));
2413
2448
  }
2414
2449
  if (enableReact) {
2415
- configs.push(react({
2450
+ configs2.push(react({
2416
2451
  ...resolveSubOptions(options, "react"),
2417
2452
  overrides: getOverrides(options, "react"),
2418
2453
  tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2419
2454
  }));
2420
2455
  }
2421
2456
  if (enableSolid) {
2422
- configs.push(
2457
+ configs2.push(
2423
2458
  solid({
2424
2459
  ...resolveSubOptions(options, "solid"),
2425
2460
  overrides: getOverrides(options, "solid"),
@@ -2428,7 +2463,7 @@ function luxass(options = {}, ...userConfigs) {
2428
2463
  );
2429
2464
  }
2430
2465
  if (enableSvelte) {
2431
- configs.push(
2466
+ configs2.push(
2432
2467
  svelte({
2433
2468
  ...resolveSubOptions(options, "svelte"),
2434
2469
  overrides: getOverrides(options, "svelte"),
@@ -2438,7 +2473,7 @@ function luxass(options = {}, ...userConfigs) {
2438
2473
  );
2439
2474
  }
2440
2475
  if (enableVue) {
2441
- configs.push(
2476
+ configs2.push(
2442
2477
  vue({
2443
2478
  ...resolveSubOptions(options, "vue"),
2444
2479
  overrides: getOverrides(options, "vue"),
@@ -2448,7 +2483,7 @@ function luxass(options = {}, ...userConfigs) {
2448
2483
  );
2449
2484
  }
2450
2485
  if (enableAstro) {
2451
- configs.push(
2486
+ configs2.push(
2452
2487
  astro({
2453
2488
  ...resolveSubOptions(options, "astro"),
2454
2489
  overrides: getOverrides(options, "astro"),
@@ -2457,19 +2492,19 @@ function luxass(options = {}, ...userConfigs) {
2457
2492
  );
2458
2493
  }
2459
2494
  if (enableUnoCSS) {
2460
- configs.push(unocss({
2495
+ configs2.push(unocss({
2461
2496
  ...resolveSubOptions(options, "unocss"),
2462
2497
  overrides: getOverrides(options, "unocss")
2463
2498
  }));
2464
2499
  }
2465
2500
  if (enableTailwindCSS) {
2466
- configs.push(tailwindcss({
2501
+ configs2.push(tailwindcss({
2467
2502
  ...resolveSubOptions(options, "tailwindcss"),
2468
2503
  overrides: getOverrides(options, "tailwindcss")
2469
2504
  }));
2470
2505
  }
2471
2506
  if (options.jsonc ?? true) {
2472
- configs.push(
2507
+ configs2.push(
2473
2508
  jsonc({
2474
2509
  overrides: getOverrides(options, "jsonc"),
2475
2510
  stylistic: stylisticOptions
@@ -2479,19 +2514,19 @@ function luxass(options = {}, ...userConfigs) {
2479
2514
  );
2480
2515
  }
2481
2516
  if (options.yaml ?? true) {
2482
- configs.push(yaml({
2517
+ configs2.push(yaml({
2483
2518
  overrides: getOverrides(options, "yaml"),
2484
2519
  stylistic: stylisticOptions
2485
2520
  }));
2486
2521
  }
2487
2522
  if (options.toml ?? true) {
2488
- configs.push(toml({
2523
+ configs2.push(toml({
2489
2524
  overrides: getOverrides(options, "toml"),
2490
2525
  stylistic: stylisticOptions
2491
2526
  }));
2492
2527
  }
2493
2528
  if (options.markdown ?? true) {
2494
- configs.push(
2529
+ configs2.push(
2495
2530
  markdown({
2496
2531
  exts,
2497
2532
  overrides: getOverrides(options, "markdown")
@@ -2499,7 +2534,7 @@ function luxass(options = {}, ...userConfigs) {
2499
2534
  );
2500
2535
  }
2501
2536
  if (options.formatters) {
2502
- configs.push(formatters(
2537
+ configs2.push(formatters(
2503
2538
  options.formatters,
2504
2539
  typeof stylisticOptions === "boolean" ? {} : stylisticOptions
2505
2540
  ));
@@ -2511,11 +2546,11 @@ function luxass(options = {}, ...userConfigs) {
2511
2546
  return acc;
2512
2547
  }, {});
2513
2548
  if (Object.keys(fusedConfig).length) {
2514
- configs.push([fusedConfig]);
2549
+ configs2.push([fusedConfig]);
2515
2550
  }
2516
2551
  let composer = new FlatConfigComposer();
2517
2552
  composer = composer.append(
2518
- ...configs,
2553
+ ...configs2,
2519
2554
  ...userConfigs
2520
2555
  );
2521
2556
  if (autoRenamePlugins) {
@@ -2573,6 +2608,7 @@ export {
2573
2608
  node,
2574
2609
  parserPlain,
2575
2610
  react,
2611
+ regexp,
2576
2612
  renameRules,
2577
2613
  resolveSubOptions,
2578
2614
  solid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.4.3",
3
+ "version": "4.5.0",
4
4
  "description": "ESLint config for @luxass",
5
5
  "type": "module",
6
6
  "author": {
@@ -8,7 +8,7 @@
8
8
  "email": "lucasnrgaard@gmail.com",
9
9
  "url": "https://luxass.dev"
10
10
  },
11
- "packageManager": "pnpm@9.0.6",
11
+ "packageManager": "pnpm@9.1.3",
12
12
  "license": "MIT",
13
13
  "repository": {
14
14
  "type": "git",
@@ -50,17 +50,17 @@
50
50
  "peerDependencies": {
51
51
  "@eslint-react/eslint-plugin": "^1.5.8",
52
52
  "@unocss/eslint-plugin": ">=0.50.0",
53
- "astro-eslint-parser": "^0.16.3",
53
+ "astro-eslint-parser": "^1.0.2",
54
54
  "eslint": ">=8.40.0",
55
- "eslint-plugin-astro": "^0.31.4",
55
+ "eslint-plugin-astro": "^1.2.0",
56
56
  "eslint-plugin-format": ">=0.1.0",
57
57
  "eslint-plugin-react-hooks": "^4.6.0",
58
58
  "eslint-plugin-react-refresh": "^0.4.4",
59
- "eslint-plugin-solid": "^0.1.0",
59
+ "eslint-plugin-solid": "^0.14.0",
60
60
  "eslint-plugin-svelte": ">=2.37.0",
61
- "eslint-plugin-tailwindcss": "^3.13.0",
62
- "prettier-plugin-astro": "^0.13.0",
63
- "svelte-eslint-parser": "^0.33.1"
61
+ "eslint-plugin-tailwindcss": "^3.17.0",
62
+ "prettier-plugin-astro": "^0.14.0",
63
+ "svelte-eslint-parser": "^0.36.0"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@unocss/eslint-plugin": {
@@ -104,63 +104,63 @@
104
104
  "@antfu/install-pkg": "^0.3.3",
105
105
  "@clack/prompts": "^0.7.0",
106
106
  "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
107
- "@stylistic/eslint-plugin": "^1.8.0",
108
- "@typescript-eslint/eslint-plugin": "^7.8.0",
109
- "@typescript-eslint/parser": "^7.8.0",
107
+ "@stylistic/eslint-plugin": "^2.1.0",
108
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
109
+ "@typescript-eslint/parser": "^7.11.0",
110
110
  "eslint-config-flat-gitignore": "^0.1.5",
111
- "eslint-flat-config-utils": "^0.2.4",
111
+ "eslint-flat-config-utils": "^0.2.5",
112
112
  "eslint-merge-processors": "^0.1.0",
113
- "eslint-plugin-antfu": "^2.1.2",
114
- "eslint-plugin-import-x": "^0.5.0",
115
- "eslint-plugin-jsdoc": "^48.2.3",
116
- "eslint-plugin-jsonc": "^2.15.1",
113
+ "eslint-plugin-antfu": "^2.3.3",
114
+ "eslint-plugin-import-x": "^0.5.1",
115
+ "eslint-plugin-jsdoc": "^48.2.7",
116
+ "eslint-plugin-jsonc": "^2.16.0",
117
117
  "eslint-plugin-markdown": "^5.0.0",
118
- "eslint-plugin-n": "^17.4.0",
119
- "eslint-plugin-sort-keys": "^2.3.5",
118
+ "eslint-plugin-n": "^17.7.0",
119
+ "eslint-plugin-regexp": "^2.6.0",
120
120
  "eslint-plugin-toml": "^0.11.0",
121
- "eslint-plugin-unicorn": "^52.0.0",
122
- "eslint-plugin-unused-imports": "^3.2.0",
121
+ "eslint-plugin-unicorn": "^53.0.0",
122
+ "eslint-plugin-unused-imports": "^4.0.0",
123
123
  "eslint-plugin-vitest": "^0.5.4",
124
- "eslint-plugin-vue": "^9.25.0",
124
+ "eslint-plugin-vue": "^9.26.0",
125
125
  "eslint-plugin-yml": "^1.14.0",
126
126
  "eslint-processor-vue-blocks": "^0.1.2",
127
- "globals": "^15.1.0",
127
+ "globals": "^15.3.0",
128
128
  "jsonc-eslint-parser": "^2.4.0",
129
129
  "local-pkg": "^0.5.0",
130
130
  "parse-gitignore": "^2.0.0",
131
131
  "toml-eslint-parser": "^0.9.3",
132
- "vue-eslint-parser": "^9.4.2",
133
- "yaml-eslint-parser": "^1.2.2"
132
+ "vue-eslint-parser": "^9.4.3",
133
+ "yaml-eslint-parser": "^1.2.3"
134
134
  },
135
135
  "devDependencies": {
136
- "@antfu/eslint-plugin-prettier": "^5.0.1-1",
137
- "@eslint-react/eslint-plugin": "^1.5.10",
138
- "@eslint/config-inspector": "^0.4.8",
139
- "@stylistic/eslint-plugin-migrate": "^1.8.0",
136
+ "@eslint-react/eslint-plugin": "^1.5.14",
137
+ "@eslint/config-inspector": "^0.4.10",
138
+ "@stylistic/eslint-plugin-migrate": "^2.1.0",
140
139
  "@types/eslint": "^8.56.10",
141
140
  "@types/estree": "^1.0.5",
142
141
  "@types/node": "^20.12.7",
143
- "@typescript-eslint/rule-tester": "^7.8.0",
144
- "@unocss/eslint-plugin": "^0.59.4",
142
+ "@typescript-eslint/rule-tester": "^7.11.0",
143
+ "@unocss/eslint-plugin": "^0.60.0",
145
144
  "astro-eslint-parser": "^1.0.2",
146
- "bundle-require": "^4.1.0",
147
- "eslint": "^9.2.0",
148
- "eslint-plugin-astro": "^1.1.2",
145
+ "eslint": "npm:eslint-ts-patch@9.2.0-6",
146
+ "eslint-plugin-astro": "^1.2.0",
149
147
  "eslint-plugin-format": "^0.1.1",
150
148
  "eslint-plugin-react-hooks": "^4.6.2",
151
- "eslint-plugin-react-refresh": "^0.4.6",
149
+ "eslint-plugin-react-refresh": "^0.4.7",
152
150
  "eslint-plugin-solid": "^0.14.0",
153
- "eslint-plugin-svelte": "2.38.0",
154
- "eslint-plugin-tailwindcss": "^3.15.1",
151
+ "eslint-plugin-svelte": "^2.39.0",
152
+ "eslint-plugin-tailwindcss": "^3.17.0",
155
153
  "eslint-typegen": "^0.2.4",
156
- "lint-staged": "^15.2.2",
157
- "prettier-plugin-astro": "^0.13.0",
154
+ "lint-staged": "^15.2.5",
155
+ "prettier-plugin-astro": "^0.14.0",
158
156
  "simple-git-hooks": "^2.11.1",
159
- "svelte": "^4.2.15",
160
- "svelte-eslint-parser": "^0.35.0",
157
+ "svelte": "^4.2.17",
158
+ "svelte-eslint-parser": "^0.36.0",
161
159
  "tsup": "^8.0.2",
160
+ "tsx": "^4.11.0",
162
161
  "typescript": "^5.4.5",
163
- "vitest": "^1.6.0"
162
+ "vitest": "^1.6.0",
163
+ "vue": "^3.4.27"
164
164
  },
165
165
  "simple-git-hooks": {
166
166
  "pre-commit": "pnpm lint-staged"