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

fix: Improve file ignoring #543

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andyrooger
Copy link

Addresses a few problems with ignoring files:

  • File ignore checking is async. There's no guarantee it's happened before we need to know the answer.
    • In my case I was seeing hundreds of thousands of lint errors from ignored files (in node_modules), though some did get ignored
    • I've made as much of the ignore checking synchronous as I can. ESLint does the check synchronously too so as far as I can tell, it's just receiving the result that happens async. Results are not perfect but in my case I see ~3000 unwanted lint errors rather than ~250000.
    • Only a partial fix, but I don't think there's more that can be done unless we choose to access the deprecated CLIEngine directly, or TS supports async plugins.
  • Hard-coded ignores had the opposite effect
    • They were just forcing those files to not be checked against eslint ignores - effectively forcing them to be linted.
    • I've made sure the hard-coded ignores happen synchronously, and that they actually cause the files to be ignored.
  • Windows paths weren't well supported
    • These were coming through with both forward and backslashes in Visual Studio Enterprise for me. They're also case insensitive, though the cases seemed to be consistent for me.
    • I've made the hardcoded ignores account for this, and normalized the paths before caching ignore results.

@andyrooger andyrooger changed the title Improve file ignoring fix: Improve file ignoring May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant