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(typescript-estree): add experimental mode for type-aware linting that uses a language service instead of a builder #6172

Closed
wants to merge 1 commit into from

Commits on Dec 6, 2022

  1. feat(typescript-estree): add experimental mode for type-aware linting…

    … that uses a language service instead of a builder program
    
    ## PR Checklist
    
    - [x] Steps in [CONTRIBUTING.md](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md) were taken
    
    ## Overview
    
    This is just an experiment to help address memory issues (#1192), maybe performance, and maybe out-of-sync types (#5845).
    
    I was looking into some code around the place and noticed that TS exposes the concept of a "document registry" - which is a shared cache that can be reused across certain TS data structures to deduplicate memory usage (and I assume improve performance by deduplicating work).
    
    This PR implements a new parser strategy which uses TS's "Language Service" tooling, which in turn leverages the document registry. "persistent parse" tests pass - which at least proves that it works in some manner of speaking.
    
    One interesting thing to note here is under the hood the language serivce doesn't use a builder program. I believe the idea is that the document registry is supposed to forego the performance implications of that? I don't know exactly - it will require more testing. Though it's worth mentioning that this means this could replace our current "single-run" codepaths because it doesn't use a builder program.
    
    TODO:
    - figure out how to roll-back "dirty" states
    - memory pressure testing
    - runtime performance testing
    bjz@Brads-MacBook-Pro.local committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    a092809 View commit details
    Browse the repository at this point in the history