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

Does not cache ambiguous modules #2529

Closed
stenin-nikita opened this issue Aug 23, 2022 · 5 comments
Closed

Does not cache ambiguous modules #2529

stenin-nikita opened this issue Aug 23, 2022 · 5 comments

Comments

@stenin-nikita
Copy link
Contributor

Description

The linter runs for a very long time if the "import/no-cycle" rule is enabled on a large project with typescript. I think the problem is that eslint does not cache all modules. For example, these files will always be parsed again:

Minimal repository for reproduce: https://github.com/stenin-nikita/eslint-plugin-import-bug

Possible solution

This line

if (exportMap == null) return null;

replace with:

if (exportMap == null) {
  exportCache.set(cacheKey, null);
  return null;
}

Locally, this change reduced the check time from 20 to 4 minutes for me

@stenin-nikita
Copy link
Contributor Author

May be a similar problem here #2076

@ljharb
Copy link
Member

ljharb commented Aug 24, 2022

That definitely seems like a worthy change. Care to make a PR?

@stenin-nikita
Copy link
Contributor Author

ОК. I did a PR and wrote a test

@stenin-nikita
Copy link
Contributor Author

@ljharb When will a version with this fix be released?

@ljharb
Copy link
Member

ljharb commented Sep 1, 2022

Fixed by #2531.

Releases aren't done on a particular schedule, but hopefully soon.

@ljharb ljharb closed this as completed Sep 1, 2022
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