From 38be0c0befbca52f2e50844c7e5ef41486e67f3c Mon Sep 17 00:00:00 2001 From: Carlo Corradini Date: Thu, 13 Mar 2025 16:57:45 +0100 Subject: [PATCH 1/2] fix: include mapper with no files and force non-dynamic projects to use absolute paths --- src/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index c5a8822..46ba89f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -430,7 +430,9 @@ function initMappers(options: InternalResolverOptions) { // Turn glob patterns into paths const projectPaths = [ ...new Set([ - ...configPaths.filter(path => !isDynamicPattern(path)), + ...configPaths + .filter(p => !isDynamicPattern(p)) + .map(p => path.resolve(process.cwd(), p)), ...globSync( configPaths.filter(path => isDynamicPattern(path)), { @@ -504,11 +506,6 @@ function initMappers(options: InternalResolverOptions) { : []), ] - if (files.length === 0) { - // eslint-disable-next-line unicorn/no-useless-undefined - return undefined - } - return { path: toNativePathSeparator(tsconfigResult.path), files: new Set(files.map(toNativePathSeparator)), From bfc917dea59cdececdfa2e9add80e9e3a2069905 Mon Sep 17 00:00:00 2001 From: Carlo Corradini Date: Thu, 13 Mar 2025 16:58:48 +0100 Subject: [PATCH 2/2] chore: changeset --- .changeset/new-peas-fry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/new-peas-fry.md diff --git a/.changeset/new-peas-fry.md b/.changeset/new-peas-fry.md new file mode 100644 index 0000000..c020488 --- /dev/null +++ b/.changeset/new-peas-fry.md @@ -0,0 +1,5 @@ +--- +'eslint-import-resolver-typescript': patch +--- + +fix: include mapper with no files and force non-dynamic projects to use absolute paths