Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(typescript-estree): add EXPERIMENTAL_useProjectService option to use TypeScript project service#6754
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(typescript-estree): add EXPERIMENTAL_useProjectService option to use TypeScript project service#6754
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedMar 24, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nx-cloudbot commentedMar 24, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/createProjectService.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/createProjectService.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/createProjectService.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedApr 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@## main #6754 +/- ##==========================================- Coverage 87.57% 87.47% -0.11%========================================== Files 377 379 +2 Lines 13201 13230 +29 Branches 3901 3906 +5 ==========================================+ Hits 11561 11573 +12- Misses 1261 1279 +18+ Partials 379 378 -1
Flags with carried forward coverage won't be shown.Click here to find out more.
|
Uh oh!
There was an error while loading.Please reload this page.
JoshuaKGoldberg commentedJun 13, 2023
Re-requesting review from@bradzacher because I applied a couple of small touchups & answered a question. But otherwise I feel comfortable merging this after we get v6 out the door (just to be safe & not conflict with the v6 release). Woop woop! 🚀 |
bradzacher left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ritschwumm commentedJul 10, 2023
may i ask what happened with this PR - is it merged now, or had it to be abandoned? |
JoshuaKGoldberg commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This was unintentionally auto-closed when we merged the |
JoshuaKGoldberg commentedJul 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Now that
Note that we're keeping the FYI@jakebailey - we're moving quickly this month! ⚡ |
JoshuaKGoldberg commentedJul 15, 2023
https://github.com/typescript-eslint/typescript-eslint/milestone/10 has a small enough number of bugs -and no major architectural issues- reported that I feel comfortable merging this in. Hooray! 🚀 (knocking on wood, fingers crossed 🤞) |
JoshuaKGoldberg commentedJul 16, 2023
| unit_tests_tsserver: | ||
| name:Run Unit Tests with Experimental TSServer | ||
| needs:[build] | ||
| runs-on:ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| package: | ||
| [ | ||
| 'eslint-plugin', | ||
| 'eslint-plugin-internal', | ||
| 'eslint-plugin-tslint', | ||
| 'typescript-estree', | ||
| ] | ||
| env: | ||
| COLLECT_COVERAGE:false | ||
| steps: | ||
| -name:Checkout | ||
| uses:actions/checkout@v3 | ||
| with: | ||
| fetch-depth:2 | ||
| -name:Install | ||
| uses:./.github/actions/prepare-install | ||
| with: | ||
| node-version:18 | ||
| -name:Build | ||
| uses:./.github/actions/prepare-build | ||
| -name:Run unit tests for ${{ matrix.package }} | ||
| run:npx nx test ${{ matrix.package }} --coverage=false | ||
| env: | ||
| CI:true | ||
| TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER:true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.



Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Creates an experimental ready-to-try-only-if-you-dare prototype implementation of#6575: using TypeScript's "project service" / server to create programs instead of our existing manual project creation. Doing so brings the"create program(s) for source files" part of typed linting towards how editors behave:
tsconfig.jsonfor each file (similar toparserOptions.project: true)tsconfig.jsonif one is not found applicable to the fileTechnical Details
In essence, this PR:
EXPERIMENTAL_useProjectServiceoption to typescript-estreeprocess.env.TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVERcan also enable the optioncreateParserSettingsto call to a newcreateProjectServicefunction lazily when the experimental option is enabled (thereby settingparseSettings.EXPERIMENTAL_projectService)getProgramAndASTto use that project service if it exists, with a newuseProgramFromProjectServiceSeehttps://github.com/JoshuaKGoldberg/repros/tree/cbe9d9c9b19c09b085a0be2024221b2d05753cc8 for a reproduction case showing this working.
Performance Comparison
Complete Project Linting
v662.976 s ± 0.479 s65.383 s ± 0.226 s31.169 s ± 0.401 sIncremental Project Linting
eslint-plugin/src/rules/*.ts8.552 s ± 0.100 s9.525 s ± 0.084 spackages/typescript-estree/src/create-program/*.ts7.162 s ± 0.079 s2.153 s ± 0.007 spackages/website/**/*.tsx9.955 s ± 0.080 s3.714 s ± 0.029 s