Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

JoshuaKGoldberg
Copy link
Member

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 afeat: I think.

💖

@typescript-eslint
Copy link
Contributor

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.

@netlifyNetlify
Copy link

netlifybot commentedJan 3, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commite9fe780
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/678465d8b1a1890008263d01
😎 Deploy Previewhttps://deploy-preview-10599--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJan 3, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commite9fe780.

CommandStatusDurationResult
nx run-many --target=build --exclude website --...✅ Succeeded2sView ↗
nx run-many --target=clean✅ Succeeded11sView ↗

☁️Nx Cloud last updated this comment at2025-01-13 01:13:13 UTC

@codecovCodecov
Copy link

codecovbot commentedJan 3, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is96.42857% with1 line in your changes missing coverage. Please review.

Project coverage is 86.91%. Comparing base(d63ea3b) to head(106bd47).
Report is 22 commits behind head on main.

Current head106bd47 differs from pull request most recent heade9fe780

Pleaseupload reports for the commite9fe780 to get more accurate results.

Files with missing linesPatch %Lines
...slint-plugin-internal/src/rules/debug-namespace.ts95.00%0 Missing and 1 partial⚠️
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
FlagCoverage Δ
unittest86.91% <96.42%> (+0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Files with missing linesCoverage Δ
packages/type-utils/src/predicates.ts21.21% <100.00%> (ø)
...estree/src/create-program/createIsolatedProgram.ts64.00% <100.00%> (ø)
...-estree/src/create-program/createProjectProgram.ts100.00% <100.00%> (ø)
...-estree/src/create-program/createProjectService.ts95.65% <100.00%> (ø)
...ript-estree/src/create-program/createSourceFile.ts90.00% <100.00%> (ø)
.../src/create-program/getWatchProgramsForProjects.ts82.85% <100.00%> (ø)
...t-estree/src/create-program/useProvidedPrograms.ts100.00% <100.00%> (ø)
...pt-estree/src/parseSettings/createParseSettings.ts81.57% <ø> (ø)
...-estree/src/parseSettings/getProjectConfigFiles.ts100.00% <100.00%> (ø)
...ipt-estree/src/parseSettings/resolveProjectList.ts97.77% <ø> (ø)
... and1 more

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewJanuary 3, 2025 07:59
bradzacher
bradzacher previously approved these changesJan 3, 2025
Comment on lines 8 to 9
const matched =
/typescript-eslint[\\/]+packages[\\/]+([a-z-]+)[\\/]+(.+)/.exec(filePath);
Copy link
Member

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.

JoshuaKGoldberg reacted with thumbs up emoji
Copy link
MemberAuthor

@JoshuaKGoldbergJoshuaKGoldbergJan 13, 2025
edited
Loading

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 explicitfilenames. But +1 that this regex is unseemly. I switched to.split(/packages[\\/]+/) and added a bit more testing.

@JoshuaKGoldbergJoshuaKGoldberg merged commit49a94b3 intotypescript-eslint:mainJan 13, 2025
45 of 61 checks passed
@JoshuaKGoldbergJoshuaKGoldberg deleted the debug-lint-rule branchJanuary 13, 2025 12:43
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJan 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Repo: Standardize debug namespaces per-file
2 participants
@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp