@bfra.me/eslint-config 0.20.11 → 0.21.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/lib/index.js CHANGED
@@ -38,20 +38,19 @@ __name(requireOf, "requireOf");
38
38
 
39
39
  // src/configs/fallback.ts
40
40
  async function fallback(missingList, options) {
41
- const rules = await interopDefault(import("./missing-module-for-config-CCTLFT6B.js"));
41
+ const rules = await interopDefault(import("./missing-module-for-config-6AHLDIAE.js"));
42
+ const pluginName = `@bfra.me${missingList.length > 0 ? `/missing-modules-${missingList.map((m) => m.replaceAll(/[^a-z0-9]/gi, "-").toLowerCase()).join("-")}` : ""}`;
42
43
  return [
43
44
  {
44
45
  plugins: {
45
- get "@bfra.me"() {
46
- return {
47
- rules: {
48
- "missing-module-for-config": rules
49
- }
50
- };
46
+ [pluginName]: {
47
+ rules: {
48
+ "missing-module-for-config": rules
49
+ }
51
50
  }
52
51
  },
53
52
  rules: {
54
- "@bfra.me/missing-module-for-config": [
53
+ [`${pluginName}/missing-module-for-config`]: [
55
54
  "error",
56
55
  missingList
57
56
  ]
@@ -649,7 +648,7 @@ __name(jsdoc, "jsdoc");
649
648
  import { fileURLToPath } from "url";
650
649
 
651
650
  // package.json
652
- var version = "0.20.11";
651
+ var version = "0.21.0";
653
652
 
654
653
  // src/parsers/any-parser.ts
655
654
  var lineBreakPattern = /\r\n|[\n\r\u2028\u2029]/u;
@@ -11,8 +11,8 @@ import { spawnSync } from "child_process";
11
11
  import { existsSync } from "fs";
12
12
  import { resolve } from "path";
13
13
  import process from "process";
14
+ import { packageDirectorySync } from "package-directory";
14
15
  import { resolveCommand } from "package-manager-detector";
15
- import { packageDirectorySync } from "pkg-dir";
16
16
  var installedModules = /* @__PURE__ */ new Set();
17
17
  function tryInstall(module, targetFile = process.cwd()) {
18
18
  if (installedModules.has(module)) {
@@ -173,4 +173,4 @@ export {
173
173
  create,
174
174
  meta
175
175
  };
176
- //# sourceMappingURL=missing-module-for-config-CCTLFT6B.js.map
176
+ //# sourceMappingURL=missing-module-for-config-6AHLDIAE.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bfra.me/eslint-config",
3
- "version": "0.20.11",
3
+ "version": "0.21.0",
4
4
  "description": "Shared ESLint configuration for bfra.me",
5
5
  "keywords": [
6
6
  "bfra.me",
@@ -48,7 +48,7 @@
48
48
  "eslint-plugin-jsonc": "2.20.1",
49
49
  "eslint-plugin-n": "17.19.0",
50
50
  "eslint-plugin-perfectionist": "4.14.0",
51
- "eslint-plugin-regexp": "2.8.0",
51
+ "eslint-plugin-regexp": "2.9.0",
52
52
  "eslint-plugin-toml": "0.12.0",
53
53
  "eslint-plugin-unicorn": "59.0.1",
54
54
  "eslint-plugin-unused-imports": "4.1.4",
@@ -56,12 +56,12 @@
56
56
  "globals": "16.2.0",
57
57
  "is-in-ci": "1.0.0",
58
58
  "local-pkg": "1.1.1",
59
+ "package-directory": "8.1.0",
59
60
  "package-manager-detector": "1.3.0",
60
- "pkg-dir": "8.0.0",
61
61
  "typescript-eslint": "8.33.1"
62
62
  },
63
63
  "devDependencies": {
64
- "@eslint/config-inspector": "1.0.2",
64
+ "@eslint/config-inspector": "1.1.0",
65
65
  "@eslint/js": "9.28.0",
66
66
  "@types/eslint-config-prettier": "6.11.3",
67
67
  "@typescript-eslint/types": "8.33.1",
@@ -69,14 +69,14 @@
69
69
  "eslint": "9.28.0",
70
70
  "eslint-config-prettier": "10.1.5",
71
71
  "eslint-plugin-no-only-tests": "3.3.0",
72
- "eslint-plugin-node-dependencies": "1.1.1",
72
+ "eslint-plugin-node-dependencies": "1.1.2",
73
73
  "eslint-plugin-prettier": "5.4.1",
74
74
  "eslint-typegen": "2.2.0",
75
75
  "tsup": "8.5.0",
76
76
  "tsx": "4.19.4",
77
- "@bfra.me/tsconfig": "0.9.7",
77
+ "@bfra.me/eslint-config": "0.21.0",
78
78
  "@bfra.me/prettier-config": "0.15.5",
79
- "@bfra.me/eslint-config": "0.20.11"
79
+ "@bfra.me/tsconfig": "0.9.7"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@vitest/eslint-plugin": "^1.1.21",
@@ -1,4 +1,3 @@
1
- import type {ESLint} from 'eslint'
2
1
  import type {Config} from '../config'
3
2
  import {interopDefault} from '../plugins'
4
3
 
@@ -13,19 +12,26 @@ export async function fallback(
13
12
  options?: FallbackOptions,
14
13
  ): Promise<Config[]> {
15
14
  const rules = await interopDefault(import('../rules/missing-module-for-config'))
15
+ // Create a unique ID using the short hash of the missing modules to ensure the plugin name is unique
16
+ const pluginName = `@bfra.me${
17
+ missingList.length > 0
18
+ ? `/missing-modules-${missingList
19
+ .map(m => m.replaceAll(/[^a-z0-9]/gi, '-').toLowerCase())
20
+ .join('-')}`
21
+ : ''
22
+ }`
23
+
16
24
  return [
17
25
  {
18
26
  plugins: {
19
- get '@bfra.me'() {
20
- return {
21
- rules: {
22
- 'missing-module-for-config': rules,
23
- },
24
- } as ESLint.Plugin
27
+ [pluginName]: {
28
+ rules: {
29
+ 'missing-module-for-config': rules,
30
+ },
25
31
  },
26
32
  },
27
33
  rules: {
28
- '@bfra.me/missing-module-for-config': ['error', missingList],
34
+ [`${pluginName}/missing-module-for-config`]: ['error', missingList],
29
35
  },
30
36
  ...(options ?? {}),
31
37
  } as Config,
@@ -2,8 +2,8 @@ import {spawnSync} from 'node:child_process'
2
2
  import {existsSync} from 'node:fs'
3
3
  import {resolve} from 'node:path'
4
4
  import process from 'node:process'
5
+ import {packageDirectorySync} from 'package-directory'
5
6
  import {resolveCommand, type AgentName} from 'package-manager-detector'
6
- import {packageDirectorySync} from 'pkg-dir'
7
7
 
8
8
  const installedModules = new Set<string>()
9
9