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: standardize debug namespaces to file paths#10599
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: standardize debug namespaces to file paths#10599
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 commentedJan 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 site configuration. |
nx-cloudbot commentedJan 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 commite9fe780.
☁️Nx Cloud last updated this comment at |
codecovbot commentedJan 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.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #10599 +/- ##==========================================+ Coverage 86.90% 86.91% +0.01%========================================== Files 446 447 +1 Lines 15505 15525 +20 Branches 4517 4521 +4 ==========================================+ Hits 13475 13494 +19 Misses 1675 1675- Partials 355 356 +1
Flags with carried forward coverage won't be shown.Click here to find out more.
|
const matched = | ||
/typescript-eslint[\\/]+packages[\\/]+([a-z-]+)[\\/]+(.+)/.exec(filePath); |
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.
Probably better to just make this a path relative to this file? EgpkgsRoot = path.resolve('..', '..', '..'); relativePath = file.replace(pkgsRoot, '..');
That way the rule doesn't rely on the folder name.
JoshuaKGoldbergJan 13, 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.
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.
Ah, those got irksome to deal with in unit tests with explicitfilename
s. But +1 that this regex is unseemly. I switched to.split(/packages[\\/]+/)
and added a bit more testing.
49a94b3
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Adds a new
@typescript-eslint/internal/debug-namespace
lint rule that makes sure anyconst log = debug('...')
uses a namespace equivalent to the package name, file directory, and file path.This caught several discrepancies in existing namespaces. I don't think we need to count this as a breaking change as those namespaces really aren't part of the public API. But this does constitute a
feat:
I think.💖