Skip to content

Commit bc50328

Browse files
committed
ci: debug windows issue on CI
1 parent d08485b commit bc50328

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.changeset/friendly-weeks-act.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"eslint-import-resolver-typescript": major
33
---
44

5-
feat!: rewrite, speed up by using `rspack-resolver` which supports `references` natively under the hood
5+
feat!: rewrite, speed up by using [`rspack-resolver`](https://github.com/unrs/rspack-resolver) which supports `references` natively under the hood
66

77
BREAKING CHANGES:
88

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ jobs:
4747
- name: Lint and Test
4848
if: ${{ matrix.node != 16}}
4949
run: yarn run-s lint test
50+
env:
51+
DEBUG: eslint-import-resolver-typescript

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export const resolve = (
8989

9090
if (!resolver) {
9191
const optionsHash = stableHash(options)
92-
options = normalizeOptions(options)
92+
const cwd = process.cwd()
93+
options = normalizeOptions(options, cwd)
9394
// take `cwd` into account -- #217
9495
const cacheKey = `${optionsHash}:${process.cwd()}`
9596
let cached = resolverCache.get(cacheKey)

src/normalize-options.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'node:path'
2+
13
import type { TsconfigOptions } from 'rspack-resolver'
24
import { globSync, isDynamicPattern } from 'tinyglobby'
35

@@ -22,10 +24,12 @@ let warned: boolean | undefined
2224

2325
export function normalizeOptions(
2426
options?: TypeScriptResolverOptions | null,
27+
cwd?: string,
2528
): TypeScriptResolverOptions
2629
// eslint-disable-next-line sonarjs/cognitive-complexity
2730
export function normalizeOptions(
2831
options?: TypeScriptResolverOptions | null,
32+
cwd = process.cwd(),
2933
): TypeScriptResolverOptions {
3034
let { project, tsconfig, noWarnOnMultipleProjects } = (options ||= {})
3135

@@ -38,13 +42,18 @@ export function normalizeOptions(
3842
ensured = true
3943
} else if (project) {
4044
project = Array.isArray(project) ? project : [project]
45+
log('original projects:', ...project)
4146
if (project.some(p => isDynamicPattern(p))) {
42-
project = globSync(project, {
43-
absolute: true,
44-
dot: true,
45-
onlyFiles: false,
46-
ignore: DEFAULT_IGNORE,
47-
})
47+
project = globSync(
48+
project.map(p => path.posix.normalize(p)),
49+
{
50+
absolute: true,
51+
cwd: path.posix.normalize(cwd),
52+
dot: true,
53+
onlyFiles: false,
54+
ignore: DEFAULT_IGNORE,
55+
},
56+
)
4857
}
4958
project = project.flatMap(p => tryFile(DEFAULT_TRY_PATHS, false, p) || [])
5059
log('resolved projects:', ...project)

0 commit comments

Comments
 (0)