Skip to content

Commit f63d1ba

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

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
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/helpers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ export const sortProjectsByAffinity = (projects: string[], file: string) => {
6666
.sort((a, b) => a.affinity - b.affinity)
6767
.map(item => item.project)
6868
}
69+
70+
export const toGlobPath = (pathname: string) => pathname.replaceAll('\\', '/')
71+
72+
export const toNativePath = (pathname: string) =>
73+
'/' === path.sep ? pathname : pathname.replaceAll('/', '\\')

src/normalize-options.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
defaultExtensions,
1111
defaultMainFields,
1212
} from './constants.js'
13-
import { tryFile } from './helpers.js'
13+
import { toGlobPath, toNativePath, tryFile } from './helpers.js'
1414
import { log } from './logger.js'
1515
import type { TypeScriptResolverOptions } from './types.js'
1616

@@ -38,15 +38,19 @@ export function normalizeOptions(
3838
ensured = true
3939
} else if (project) {
4040
project = Array.isArray(project) ? project : [project]
41+
log('original projects:', ...project)
4142
if (project.some(p => isDynamicPattern(p))) {
42-
project = globSync(project, {
43+
project = globSync(project.map(toGlobPath), {
4344
absolute: true,
4445
dot: true,
46+
expandDirectories: false,
4547
onlyFiles: false,
4648
ignore: DEFAULT_IGNORE,
4749
})
4850
}
49-
project = project.flatMap(p => tryFile(DEFAULT_TRY_PATHS, false, p) || [])
51+
project = project.flatMap(
52+
p => tryFile(DEFAULT_TRY_PATHS, false, toNativePath(p)) || [],
53+
)
5054
log('resolved projects:', ...project)
5155
if (project.length === 1) {
5256
configFile = project[0]

0 commit comments

Comments
 (0)