From a14fdd95011c4c09b74f71854410f684c0f04bc5 Mon Sep 17 00:00:00 2001 From: Carlo Corradini Date: Thu, 13 Mar 2025 18:03:50 +0100 Subject: [PATCH 1/2] fix: include mapper with no files and force non-dynamic projects to use absolute paths (#377) --- .changeset/new-peas-fry.md | 5 +++++ src/index.ts | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) 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 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 904356bd14469f532feddaa07cda2a02169c1c01 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:29:05 +0000 Subject: [PATCH 2/2] chore: release eslint-import-resolver-typescript (#378) --- .changeset/new-peas-fry.md | 5 ----- CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/new-peas-fry.md diff --git a/.changeset/new-peas-fry.md b/.changeset/new-peas-fry.md deleted file mode 100644 index c020488..0000000 --- a/.changeset/new-peas-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'eslint-import-resolver-typescript': patch ---- - -fix: include mapper with no files and force non-dynamic projects to use absolute paths diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c06004..dc7202b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 3.8.7 + +### Patch Changes + +- [#377](https://github.com/import-js/eslint-import-resolver-typescript/pull/377) [`a14fdd9`](https://github.com/import-js/eslint-import-resolver-typescript/commit/a14fdd95011c4c09b74f71854410f684c0f04bc5) Thanks [@carlocorradini](https://github.com/carlocorradini)! - fix: include mapper with no files and force non-dynamic projects to use absolute paths + ## 3.8.6 ### Patch Changes diff --git a/package.json b/package.json index 8d601b8..128f7b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-import-resolver-typescript", - "version": "3.8.6", + "version": "3.8.7", "type": "module", "description": "This plugin adds `TypeScript` support to `eslint-plugin-import`", "repository": "git+https://github.com/import-js/eslint-import-resolver-typescript",