fix: resolve modules if folder contains a package.json file
getMappedPath resolves files by trying a number of different file extensions and filtering out those that aren't a file. This does not work when a TSConfig path alias resolves to a directory containing built assets, and described by a package.json, e.g. @foo/bar -> node_modules/foo/bar/dist.
If the tsconfig path is mapped to a folder that doesn't contain an index.${ext} file, then getMappedPath returns undefined as the folder itself is not a file. However, in some cases it is ok for this to resolve to the directory as the package.json contains a typings entry that references a .d.ts file, which is correctly handled by enhanced-resolve.
https://github.com/import-js/eslint-import-resolver-typescript/issues/188
🦋 Changeset detected
Latest commit: 27b4ce89170485907e32a346dfebcc1b6f0bd214
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| eslint-import-resolver-typescript | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
@scott-ut Thanks for your contribution!