Skip to content

Commit e8b61a0

Browse files
committed
ci: debug Windows error
1 parent f75c0e4 commit e8b61a0

File tree

8 files changed

+386
-506
lines changed

8 files changed

+386
-506
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ jobs:
1414
strategy:
1515
matrix:
1616
os:
17-
- macos-latest
18-
- ubuntu-latest
17+
# - macos-latest
18+
# - ubuntu-latest
1919
- windows-latest
2020
node:
21-
- 18
22-
- 20
23-
- 22
21+
# - 18
22+
# - 20
23+
# - 22
2424
# https://github.com/nodejs/node/issues/59480
2525
- 24.5
2626
eslint:
27-
- 8.56
28-
- 8
27+
# - 8.56
28+
# - 8
2929
- 9
3030

3131
include:

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"eslint-import-context": "^0.2.0",
8282
"is-glob": "^4.0.3",
8383
"minimatch": "^9.0.3 || ^10.0.3",
84-
"oxc-resolver": "^11.6.1",
84+
"oxc-resolver": "^11.6.2",
8585
"semver": "^7.7.2",
8686
"stable-hash-x": "^0.2.0"
8787
},
@@ -168,7 +168,8 @@
168168
},
169169
"resolutions": {
170170
"@typescript-eslint/utils": "^8.34.0",
171-
"prettier": "^3.5.3"
171+
"prettier": "^3.5.3",
172+
"unrs-resolver": "npm:oxc-resolver@^11.6.2"
172173
},
173174
"eslintIgnore": [
174175
".yarn",

test/fixtures/yarn-pnp/.env.yarn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
DEBUG=eslint-import-resolver-typescript
12
ESLINT_USE_FLAT_CONFIG=true
3+
RUST_BACKTRACE=1
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff --git a/lib/index.cjs b/lib/index.cjs
2+
index b651f12ee9ec9aa03ac7acaf0f43a0f703ce4d28..08fead57873e55cca3f80a5d2403d22f595e1c2b 100644
3+
--- a/lib/index.cjs
4+
+++ b/lib/index.cjs
5+
@@ -250,13 +250,21 @@ const resolverCache = /* @__PURE__ */ new Map();
6+
const tsconfigCache = /* @__PURE__ */ new Map();
7+
const matcherCache = /* @__PURE__ */ new Map();
8+
const unrsResolve = (source, file, resolver) => {
9+
- const result = resolver.sync(node_path.default.dirname(file), source);
10+
+ let result;
11+
+ try {
12+
+ result = resolver.sync(node_path.default.dirname(file), source);
13+
+ } catch (err) {
14+
+ log('------------------------------');
15+
+ log(source, file);
16+
+ log('------------------------------');
17+
+ throw err;
18+
+ }
19+
if (result.path) return {
20+
found: true,
21+
path: result.path
22+
};
23+
if (result.error) {
24+
- log("unrs-resolver error:", result.error);
25+
+ log("unrs-resolver error:", source, file, result.error);
26+
if (TSCONFIG_NOT_FOUND_REGEXP.test(result.error)) throw new Error(result.error);
27+
}
28+
return { found: false };
29+
diff --git a/lib/index.js b/lib/index.js
30+
index 377c5e83795338dd22acf9e528de4a73335add99..00fdd2d7d683763e292c6a4ab2b93a41496b222c 100644
31+
--- a/lib/index.js
32+
+++ b/lib/index.js
33+
@@ -16,7 +16,15 @@ const resolverCache = new Map();
34+
const tsconfigCache = new Map();
35+
const matcherCache = new Map();
36+
const unrsResolve = (source, file, resolver) => {
37+
- const result = resolver.sync(path.dirname(file), source);
38+
+ let result;
39+
+ try {
40+
+ result = resolver.sync(path.dirname(file), source);
41+
+ } catch (err) {
42+
+ log('------------------------------');
43+
+ log(source, file);
44+
+ log('------------------------------');
45+
+ throw err;
46+
+ }
47+
if (result.path) {
48+
return {
49+
found: true,

test/fixtures/yarn-pnp/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"devDependencies": {
1616
"epix-oxc": "link:.",
1717
"eslint": "^9.29.0",
18+
"eslint-import-resolver-typescript": "patch:eslint-import-resolver-typescript@npm%3A4.4.3#~/.yarn/patches/eslint-import-resolver-typescript-npm-4.4.3-f982fbc045.patch",
1819
"eslint-plugin-import-x": "link:../../.."
20+
},
21+
"resolutions": {
22+
"eslint-import-resolver-typescript": "patch:eslint-import-resolver-typescript@npm%3A4.4.3#~/.yarn/patches/eslint-import-resolver-typescript-npm-4.4.3-f982fbc045.patch",
23+
"unrs-resolver": "npm:oxc-resolver@^11.6.2"
1924
}
2025
}

test/fixtures/yarn-pnp/test-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@types/node": "^22.15.32",
1616
"@typescript-eslint/parser": "^8.34.1",
1717
"eslint": "^9.29.0",
18-
"eslint-import-resolver-typescript": "^4.4.3",
18+
"eslint-import-resolver-typescript": "patch:eslint-import-resolver-typescript@npm%3A4.4.3#~/.yarn/patches/eslint-import-resolver-typescript-npm-4.4.3-f982fbc045.patch",
1919
"eslint-plugin-import-x": "link:../../../..",
2020
"globals": "^16.2.0",
2121
"tsx": "^4.20.3",

0 commit comments

Comments
 (0)