Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(typescript-estree): adds support for project services using extended config files#9306
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@higherorderfunctor! 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 commentedJun 8, 2024 • 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. |
nx-cloudbot commentedJun 8, 2024 • 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.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit4478aea. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 fromNxCloud. |
codecovbot commentedJun 8, 2024 • 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## v8 #9306 +/- ##==========================================+ Coverage 88.01% 88.04% +0.03%========================================== Files 401 402 +1 Lines 13637 13639 +2 Branches 3960 3959 -1 ==========================================+ Hits 12003 12009 +6+ Misses 1325 1322 -3+ Partials 309 308 -1
Flags with carried forward coverage won't be shown.Click here to find out more.
|
JoshuaKGoldberg left a comment• 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.
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.
I like the general direction! +1 on extracting out agetParsedConfigFile, that's really useful. 🚀
Requesting changes mostly on reorganization, and therequire()ing too. Cheers!
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
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/tests/lib/createProjectService.test.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…ts with review feedbackCo-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
JoshuaKGoldberg commentedJul 17, 2024
👋 are you waiting on us for anything@higherorderfunctor? |
higherorderfunctor commentedJul 17, 2024
Nope! I'll be picking this back up this week / weekend. Had a vacation and some deadlines the last two weeks. |
JoshuaKGoldberg commentedJul 18, 2024
Great! Let's time box this to a week from now, then - we really want to release v8 as soon as possible. |
higherorderfunctor commentedJul 23, 2024
Created Will revert most of the changes to Plan to be done by tonight. |
higherorderfunctor commentedJul 24, 2024
@JoshuaKGoldberg I will have some time tomorrow to check on the CI for any errors or for any final edits you would like to make. Thanks! |
JoshuaKGoldberg 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.
🔥 this is great, thanks!
I only have one teeny nit. It's absolutely not blocking at all. Will leave this open for a bit in case anybody else from the team has time to review.
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/typescript-estree/src/create-program/getParsedConfigFile.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
higherorderfunctor commentedJul 25, 2024
All changes made. Let me know if anything else! I think the running CI job is stuck,netlify shows complete. Opened#9641 for the test clean up. |
JoshuaKGoldberg 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.
🔥 thanks!
packages/typescript-estree/src/create-program/createProjectService.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
packages/typescript-estree/src/create-program/createProjectService.tsto usetsserver.getParsedCommandLineOfConfigFileinstead oftsserver.readConfigFileto process extended tsconfigs.tsserver.getParsedCommandLineOfConfigFileboilerplate frompackages/typescript-estree/src/create-program/useProvidedPrograms.tsinto a new filepackages/typescript-estree/src/create-program/getParsedConfigFile.tsto keep the code DRY.packages/typescript-estree/tests/lib/createProjectService.test.ts. Also adds a couple tests to round out coverage for uncommon code paths to bringgetParsedConfigFile.tsto 100% (tsserver.sys === undefinedand triggeringgetCanonicalFileNamewithtsserver.formatDiagnostics).packages/typescript-estree/tests/fixtures/projectServicesComplex/.A few implementation notes for the reviewer:
anycast inpackages/typescript-estree/src/create-program/createProjectService.ts. I left a code comment with reasoning for doing so. The originaltsserver.readConfigFilewas alsoanywith a hard cast.formatDiagnosticsin the newpackages/typescript-estree/src/create-program/getParsedConfigFile.tsfile was placed insidegetParsedConfigFile. This was only to share the lazy import of tsserver. The existing Jest mocks seem to rely on tsserver being a lazy import. I'm not very familiar with eslint's module import cache-bypassing behavior, so I don't know if there is a performance implication here. The original lazy import is also still present inpackages/typescript-estree/tests/lib/createProjectService.test.ts. We could try adding tsserver as a parameter togetParsedConfigFileto remove the extra lazy import if we think it will be a problem.mockto adoMockinside abeforeAllfor testingtsserver.env === undefinedcase. I've primarily used mocha/chai, vitest, and bun test; so if it there is a cleaner way to do this in jest I can make that update.packages/typescript-estree/tests/lib/createProjectService.test.tswere truly unit tests mocking all calls to tsserver. Wanting to test the extends behavior, some of the tests now call through to tsserver. Since these are really testing integration functionality, please let me know if adjustments are required. These tests also have slightly looser assertions since tsserver adds some metadata. A code comment has been added to mark each.projectServicesComplexfixture, specifically the project references. It may have future uses, but I can trim the currently unused project references if preferred.Inline comments work for me on the PR.