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): infer tsconfigRootDir from call stack#11370
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): infer tsconfigRootDir from call stack#11370
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 commentedJul 3, 2025 • 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 project configuration. |
Uh oh!
There was an error while loading.Please reload this page.
nx-cloudbot commentedJul 3, 2025 • 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.
View yourCI Pipeline Execution ↗ for commit718b881
☁️Nx Cloud last updated this comment at |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedJul 4, 2025 • 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #11370 +/- ##======================================= Coverage 90.85% 90.86% ======================================= Files 501 503 +2 Lines 50987 51028 +41 Branches 8410 8421 +11 =======================================+ Hits 46324 46365 +41 Misses 4648 4648 Partials 15 15
Flags with carried forward coverage won't be shown.Click here to find out more.
🚀 New features to boost your workflow:
|
@@ -3,8 +3,10 @@ import type { TSESLint } from '@typescript-eslint/utils'; | |||
importpluginBasefrom'@typescript-eslint/eslint-plugin'; | |||
importrawPluginfrom'@typescript-eslint/eslint-plugin/use-at-your-own-risk/raw-plugin'; | |||
import{addCandidateTSConfigRootDir}from'@typescript-eslint/typescript-estree'; |
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 adds dependency on a transitive dep -- which will break consumers.
the dep needs to be listed in thepackage.json
there's something with our lint config -- there should be likeimport/no-extraneous-deps
or something that's covering this.
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 thinkimport-x
would have caught this 😄
Uh oh!
There was an error while loading.Please reload this page.
7126c3a
intotypescript-eslint:mainUh 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
tsconfigRootDir
to the running flat config's directory if available #10841Overview
Adds a trio of logical pieces:
candidateTSConfigRootDirs
: stores candidate root directories insidetypescript-estree
, exposed viaadd*
,clear*
, andget*
functionsget*
,getInferredTSConfigRootDir
, will throw an error if multiple candidates have been populated. It's only called bycreateParseSettings
if notsconfigRootDir
was explicitly provided.getTSConfigRootDirFromStack
: given a call stack, gets the candidate directory hosting an ESLint config file -- if it can be foundcreateConfigsGetters
: wraps the configs intypescript-eslint
with getters that pass the result ofgetRootDirFromStack
tocandidateTSConfigRootDirs
The result is that using any configs like
tseslint.configs.recommendedTypeChecked
will attempt to populate a candidatetsconfigRootDir
for parse settings.💖