Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better algorithm for custom tsconfig paths #345

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

carlocorradini
Copy link
Contributor

Fix #246
Fix #247

Improves the overall algorithm for searching the mapped file when using custom TypeScript paths.

Each mapper now contains two fields:

  1. mapperFn
    The mapper function generated by createPathsMatcher
  2. files
    A set of files where it is allowed to execute the mapperFn.
    This resolves a number of issues, the most important of which is that two tsconfig files have the same path mapping.

One of the most important changes is to handle path separators appropriately:

  • tinyglobby pattern must have POSIX separator, otherwise isDynamicPattern returns false for some special cases (./packages/*/tsconfig.json)
  • All path operations must use native separators and be normalized.

Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: c4cd626

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 Minor

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

Copy link

codesandbox-ci bot commented Feb 12, 2025

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.

@carlocorradini
Copy link
Contributor Author

@SukkaW Can I increase the limit to ?
Only 55 Bytes more than the limit... 😥

{
    "name": "./lib/index.js",
    "passed": false,
    "size": 2855,
    "sizeLimit": 2800
  }

Copy link
Collaborator

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to increase the size limit on this one since it doesn't increase by much!

@carlocorradini carlocorradini mentioned this pull request Feb 13, 2025
@carlocorradini
Copy link
Contributor Author

@SukkaW Do you also want to add changeset message or not?

@SukkaW
Copy link
Collaborator

SukkaW commented Feb 14, 2025

@SukkaW Do you also want to add changeset message or not?

Yes, add one as well!

@carlocorradini
Copy link
Contributor Author

@SukkaW Done! 🥳

@SukkaW SukkaW added this pull request to the merge queue Feb 14, 2025
Merged via the queue into import-js:master with commit fcc8883 Feb 14, 2025
9 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Feb 14, 2025
| datasource | package                           | from  | to    |
| ---------- | --------------------------------- | ----- | ----- |
| npm        | eslint-import-resolver-typescript | 3.7.0 | 3.8.0 |


## [v3.8.0](https://github.com/import-js/eslint-import-resolver-typescript/blob/HEAD/CHANGELOG.md#380)

##### Minor Changes

-   [#345](import-js/eslint-import-resolver-typescript#345) [`fcc8883`](import-js/eslint-import-resolver-typescript@fcc8883) Thanks [@carlocorradini](https://github.com/carlocorradini)! - Enable the mapper function just for a set of allowed files. Improves project discovery using glob and POSIX separator.

-   [#346](import-js/eslint-import-resolver-typescript#346) [`c124e87`](import-js/eslint-import-resolver-typescript@c124e87) Thanks [@carlocorradini](https://github.com/carlocorradini)! - Update get-tsconfig to the the latest version. We now support the `${configDir}` variable, introduced in TypeScript 5.5.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Feb 14, 2025
| datasource | package                           | from  | to    |
| ---------- | --------------------------------- | ----- | ----- |
| npm        | eslint-import-resolver-typescript | 3.7.0 | 3.8.0 |


## [v3.8.0](https://github.com/import-js/eslint-import-resolver-typescript/blob/HEAD/CHANGELOG.md#380)

##### Minor Changes

-   [#345](import-js/eslint-import-resolver-typescript#345) [`fcc8883`](import-js/eslint-import-resolver-typescript@fcc8883) Thanks [@carlocorradini](https://github.com/carlocorradini)! - Enable the mapper function just for a set of allowed files. Improves project discovery using glob and POSIX separator.

-   [#346](import-js/eslint-import-resolver-typescript#346) [`c124e87`](import-js/eslint-import-resolver-typescript@c124e87) Thanks [@carlocorradini](https://github.com/carlocorradini)! - Update get-tsconfig to the the latest version. We now support the `${configDir}` variable, introduced in TypeScript 5.5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected error import/no-extraneous-dependencies
2 participants