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