Skip to content

Does not cache ambiguous modules #2529

Closed
@stenin-nikita

Description

@stenin-nikita

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions