Skip to content

Commit 3e54b26

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

File tree

12 files changed

+264
-426
lines changed

12 files changed

+264
-426
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ 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

31-
include:
32-
- executeLint: true
33-
node: lts/*
34-
eslint: 9
35-
os: ubuntu-latest
36-
- legacyNodeResolver: true
37-
node: lts/*
38-
eslint: 9
39-
os: ubuntu-latest
31+
# include:
32+
# - executeLint: true
33+
# node: lts/*
34+
# eslint: 9
35+
# os: ubuntu-latest
36+
# - legacyNodeResolver: true
37+
# node: lts/*
38+
# eslint: 9
39+
# os: ubuntu-latest
4040
fail-fast: false
4141

4242
runs-on: ${{ matrix.os }}

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
'^eslint-plugin-import-x/(.+)$': `<rootDir>/${srcDir}/$1`,
1616
},
1717
snapshotSerializers: ['<rootDir>/test/jest.serializer.cjs'],
18-
testMatch: ['<rootDir>/test/**/*.spec.ts'],
18+
testMatch: ['<rootDir>/test/**/fixtures.spec.ts'],
1919
transform: {
2020
'^.+\\.(m?[jt]s|[jt]sx?)$': [
2121
'@swc-node/jest',

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",

src/node-resolver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ export function createNodeResolver({
3434
if (resolved.path) {
3535
return { found: true, path: resolved.path }
3636
}
37-
} catch {
38-
//
37+
} catch (error) {
38+
console.log('----------------------')
39+
console.error(modulePath, sourceFile, error)
40+
console.log('----------------------')
3941
}
4042
return { found: false }
4143
},

src/utils/legacy-resolver-settings.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export function resolveWithLegacyResolver(
2323
sourceFile: string,
2424
): ResolvedResult {
2525
if (resolver.interfaceVersion === 2) {
26-
return resolver.resolve(modulePath, sourceFile, config)
26+
console.log(modulePath, sourceFile, config)
27+
const result = resolver.resolve(modulePath, sourceFile, config)
28+
console.log('result:', result)
29+
return result
2730
}
2831

2932
try {

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=full

test/fixtures/yarn-pnp/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
"./add": "./add.js?custom"
1111
},
1212
"scripts": {
13-
"lint": "eslint && yarn workspace test-package lint"
13+
"lint": "yarn workspace test-package lint"
1414
},
1515
"devDependencies": {
1616
"epix-oxc": "link:.",
1717
"eslint": "^9.29.0",
1818
"eslint-plugin-import-x": "link:../../.."
19+
},
20+
"resolutions": {
21+
"unrs-resolver": "1.9.2"
1922
}
2023
}

test/fixtures/yarn-pnp/test-package/eslint.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import js from '@eslint/js'
22
import { importX } from 'eslint-plugin-import-x'
33
import * as tsParser from '@typescript-eslint/parser'
4-
import { globalIgnores } from 'eslint/config'
54
import globals from 'globals'
65

76
export default [
8-
globalIgnores(['.pnp.cjs', '.yarn']),
97
js.configs.recommended,
108
importX.flatConfigs.recommended,
119
importX.flatConfigs.typescript,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"scripts": {
77
"demo": "tsx test.ts",
8-
"lint": "eslint"
8+
"lint": "tsx resolve.cts && eslint"
99
},
1010
"dependencies": {
1111
"nanoid": "^5.1.5"
@@ -15,10 +15,11 @@
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": "^4.4.4",
1919
"eslint-plugin-import-x": "link:../../../..",
2020
"globals": "^16.2.0",
2121
"tsx": "^4.20.3",
22-
"typescript": "^5.8.3"
22+
"typescript": "^5.8.3",
23+
"unrs-resolver": "1.9.2"
2324
}
2425
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import path from 'node:path'
2+
3+
import {
4+
defaultConditionNames,
5+
defaultExtensions,
6+
defaultExtensionAlias,
7+
defaultMainFields,
8+
} from 'eslint-import-resolver-typescript'
9+
import { ResolverFactory } from 'unrs-resolver'
10+
11+
const resolver = new ResolverFactory({
12+
conditionNames: defaultConditionNames,
13+
extensions: defaultExtensions,
14+
extensionAlias: defaultExtensionAlias,
15+
mainFields: defaultMainFields,
16+
})
17+
18+
const eslintJsTypes = require.resolve('@eslint/js/types/index.d.ts')
19+
20+
console.log('eslintJs', eslintJsTypes)
21+
22+
console.log(resolver.sync(path.dirname(eslintJsTypes), 'eslint'))

0 commit comments

Comments
 (0)