Skip to content

Commit a14fdd9

Browse files
fix: include mapper with no files and force non-dynamic projects to use absolute paths (#377)
1 parent 7fdfd80 commit a14fdd9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.changeset/new-peas-fry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-import-resolver-typescript': patch
3+
---
4+
5+
fix: include mapper with no files and force non-dynamic projects to use absolute paths

src/index.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ function initMappers(options: InternalResolverOptions) {
430430
// Turn glob patterns into paths
431431
const projectPaths = [
432432
...new Set([
433-
...configPaths.filter(path => !isDynamicPattern(path)),
433+
...configPaths
434+
.filter(p => !isDynamicPattern(p))
435+
.map(p => path.resolve(process.cwd(), p)),
434436
...globSync(
435437
configPaths.filter(path => isDynamicPattern(path)),
436438
{
@@ -504,11 +506,6 @@ function initMappers(options: InternalResolverOptions) {
504506
: []),
505507
]
506508

507-
if (files.length === 0) {
508-
// eslint-disable-next-line unicorn/no-useless-undefined
509-
return undefined
510-
}
511-
512509
return {
513510
path: toNativePathSeparator(tsconfigResult.path),
514511
files: new Set(files.map(toNativePathSeparator)),

0 commit comments

Comments
 (0)