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

projectPaths cwd and getTsconfig helper (performance issue) #321

Open
romanlex opened this issue Nov 7, 2024 · 1 comment
Open

projectPaths cwd and getTsconfig helper (performance issue) #321

romanlex opened this issue Nov 7, 2024 · 1 comment

Comments

@romanlex
Copy link

romanlex commented Nov 7, 2024

Anybody who can explain why inside this resolver used getTsconfig function for project config option instead of tsconfig nearest of source file

https://github.com/import-js/eslint-import-resolver-typescript/blob/master/src/index.ts#L366

For example monorepo has meny packages
Settings of import resolver is
Image

Now we get multiple project paths
Image

If I use eslintrc config inside packages with root directive I don't need to know anything about the rest of the tsconfig in the another project.

All this paths participate in calculations every time but all what we need its resolve import path inside only one package.

Why we cant use getTsconfig only for current file?
It would be much faster

@romanlex romanlex changed the title projectPaths cwd and getTsconfig helper projectPaths cwd and getTsconfig helper (performance issue) Nov 11, 2024
@SukkaW
Copy link
Collaborator

SukkaW commented Dec 11, 2024

@romanlex The current implementation is to create multiple path matcher instances with every project provided. This way we can pre-initiate a pool of path matcher instances, otherwise we will have to create a path matcher instance per file. We will then use every path matcher instance against the filesystem individually when resolving a module.

If you have any better ideas about improving this, please don't hesitate to create a PR! I am more than happy to review and merge it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants