-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(typescript-estree): add defaultProject for project service #8815
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 defaultProject for project service #8815
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 on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
|
||
| if (typeof options === 'object' && options.defaultProject) { | ||
| try { | ||
| const configRead = tsserver.readConfigFile( |
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.
Fun fact: ts.readConfigFile has two unhappy paths:
- If the config file is valid JSON but not right for TypeScript, it returns an object
- If the config file is invalid JSON, it throws
🙌 error handling!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8815 +/- ##
==========================================
- Coverage 88.02% 88.01% -0.02%
==========================================
Files 405 405
Lines 14089 14099 +10
Branches 4125 4127 +2
==========================================
+ Hits 12402 12409 +7
- Misses 1382 1385 +3
Partials 305 305
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| configRead.error, | ||
| { | ||
| getCurrentDirectory: system.getCurrentDirectory, | ||
| getCanonicalFileName: fileName => fileName, |
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 couldn't figure out a way to get this to execute in tests. 🤷
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.
Co-authored-by: Brad Zacher <[email protected]>
* feat(eslint-plugin): remove formatting/layout rules * Remove "layout" * feat(typescript-estree): add defaultProject for project service (#8815) * feat(typescript-estree): add defaultProject for project service * Thanks Jake, service.setCompilerOptionsForInferredProjects * Cleaned up a bit and added happy path testing * Update packages/typescript-estree/src/parser-options.ts Co-authored-by: Brad Zacher <[email protected]> --------- Co-authored-by: Brad Zacher <[email protected]> * feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (#8895) Co-authored-by: Brad Zacher <[email protected]> * Add tombstones * 'deprecated' typo * Let's mention both issues * Fix unused variable issue --------- Co-authored-by: Brad Zacher <[email protected]> Co-authored-by: Dave <[email protected]>
* feat(eslint-plugin): remove formatting/layout rules * Remove "layout" * feat(typescript-estree): add defaultProject for project service (#8815) * feat(typescript-estree): add defaultProject for project service * Thanks Jake, service.setCompilerOptionsForInferredProjects * Cleaned up a bit and added happy path testing * Update packages/typescript-estree/src/parser-options.ts Co-authored-by: Brad Zacher <[email protected]> --------- Co-authored-by: Brad Zacher <[email protected]> * feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (#8895) Co-authored-by: Brad Zacher <[email protected]> * Add tombstones * 'deprecated' typo * Let's mention both issues * Fix unused variable issue --------- Co-authored-by: Brad Zacher <[email protected]> Co-authored-by: Dave <[email protected]>


PR Checklist
Overview
Adds a
defaultProjectproperty to the existingProjectServiceOptionsconfig object. Folks should be able to use it like:...except, I can't find an API to use the default project in the project service. Filing as a draft for reference while I ask about it.Chatted with @jakebailey and @sandersn in the TypeScript Discord.service.setCompilerOptionsForInferredProjectsis the right API. Thanks!❤️🔥