@sushichan044/eslint-config-array-resolver 0.1.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +10 -13
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { bundleRequire } from "bundle-require";
2
1
  import { any } from "empathic/find";
3
2
  import { resolve } from "mlly";
4
- import { dirname } from "pathe";
3
+ import { dirname, normalize } from "pathe";
4
+ import { unrun } from "unrun";
5
5
  const runInDirectory = async (directory, function_) => {
6
6
  const cwd = process.cwd();
7
7
  process.chdir(directory);
@@ -56,25 +56,19 @@ const findConfigPath = (root) => {
56
56
  ], { cwd: root });
57
57
  if (!isNonEmptyString(configPath)) throw new Error("No eslint config found");
58
58
  return {
59
- basePath: dirname(configPath),
60
- fullPath: configPath
59
+ basePath: normalize(dirname(configPath)),
60
+ fullPath: normalize(configPath)
61
61
  };
62
62
  };
63
63
  const resolveFlatConfig = async (root, options = {}) => {
64
64
  const { suppressOutput = false } = options;
65
65
  const { basePath, fullPath } = findConfigPath(root);
66
- const moduleImportPromise = runInDirectory(basePath, async () => {
67
- return bundleRequire({
68
- cwd: basePath,
69
- filepath: fullPath,
70
- tsconfig: false
71
- });
72
- });
66
+ const moduleImportPromise = runInDirectory(basePath, async () => unrun({ path: fullPath }));
73
67
  const importPromise = suppressOutput ? executeWithSilentLogs(async () => moduleImportPromise) : moduleImportPromise;
74
- const { dependencies, mod } = await importPromise;
75
- const configModule = await (mod.default ?? mod);
68
+ const { dependencies, module: configModule } = await importPromise;
76
69
  const rawConfigs = Array.isArray(configModule) ? configModule : [configModule];
77
70
  rawConfigs.unshift({
71
+ index: 1,
78
72
  languageOptions: {
79
73
  ecmaVersion: "latest",
80
74
  parserOptions: {},
@@ -84,12 +78,15 @@ const resolveFlatConfig = async (root, options = {}) => {
84
78
  name: "eslint/defaults/languages"
85
79
  }, {
86
80
  ignores: ["**/node_modules/", ".git/"],
81
+ index: 2,
87
82
  name: "eslint/defaults/ignores"
88
83
  }, {
89
84
  files: ["**/*.js", "**/*.mjs"],
85
+ index: 3,
90
86
  name: "eslint/defaults/files"
91
87
  }, {
92
88
  files: ["**/*.cjs"],
89
+ index: 4,
93
90
  languageOptions: {
94
91
  ecmaVersion: "latest",
95
92
  sourceType: "commonjs"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sushichan044/eslint-config-array-resolver",
3
3
  "description": "Resolves flat config module. For internal use only.",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "author": {
@@ -32,25 +32,25 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@arethetypeswrong/cli": "0.18.2",
35
- "@biomejs/biome": "2.1.2",
35
+ "@biomejs/biome": "2.3.4",
36
36
  "@types/node": "24.1.0",
37
- "@typescript-eslint/utils": "8.38.0",
38
- "@virtual-live-lab/eslint-config": "2.2.24",
37
+ "@virtual-live-lab/eslint-config": "2.3.1",
39
38
  "@virtual-live-lab/tsconfig": "2.1.21",
40
- "eslint": "9.31.0",
39
+ "eslint": "9.39.1",
41
40
  "fs-fixture": "2.8.1",
42
41
  "publint": "0.3.12",
43
42
  "tsdown": "0.13.0",
44
- "typescript": "5.8.3",
45
- "typescript-eslint": "8.38.0",
43
+ "typescript": "5.9.3",
44
+ "typescript-eslint": "8.46.3",
46
45
  "unplugin-unused": "0.5.1",
47
- "vitest": "3.2.4"
46
+ "vitest": "4.0.8"
48
47
  },
49
48
  "dependencies": {
50
- "bundle-require": "^5.1.0",
49
+ "@typescript-eslint/utils": "^8.0.0",
51
50
  "empathic": "^2.0.0",
52
51
  "mlly": "^1.7.4",
53
- "pathe": "^2.0.3"
52
+ "pathe": "^2.0.3",
53
+ "unrun": "^0.2.6"
54
54
  },
55
55
  "scripts": {
56
56
  "lint": "eslint --max-warnings 0 --fix .",