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

fix(eslint-plugin): [consistent-type-exports] check value flag before resolving alias#11769

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

Merged

Conversation

@ntdiary
Copy link
Contributor

PR Checklist

Overview

Make sure the current symbol doesn't haveSymbolFlags.Value before resolving alias.

I submit the recursive version here, which is just 1 line shorter than thewhile iteration.
If we prefer using iteration, can be done like this:

while(symbol&&!checker.isUnknownSymbol(symbol)){if(symbol.getDeclarations()?.some(ts.isTypeOnlyImportOrExportDeclaration)){returntrue;}if(symbol.flags&ts.SymbolFlags.Value){returnfalse;}if(!(symbol.flags&ts.SymbolFlags.Alias)){returntrue;}symbol=checker.getImmediateAliasedSymbol(symbol)}returnundefined;

💖

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@ntdiary!

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.

@netlify
Copy link

netlifybot commentedNov 19, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit3e7a944
🔍 Latest deploy loghttps://app.netlify.com/projects/typescript-eslint/deploys/6926a44be8334f0008cc4b3d
😎 Deploy Previewhttps://deploy-preview-11769--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: 97 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (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 project configuration.

@nx-cloud
Copy link

nx-cloudbot commentedNov 19, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit3e7a944

CommandStatusDurationResult
nx test eslint-plugin --coverage=false✅ Succeeded5m 2sView ↗
nx run-many -t lint✅ Succeeded3m 13sView ↗
nx run-many -t typecheck✅ Succeeded1m 59sView ↗
nx test eslint-plugin-internal --coverage=false✅ Succeeded5sView ↗
nx test typescript-estree --coverage=false✅ Succeeded2sView ↗
nx run integration-tests:test✅ Succeeded4sView ↗
nx run types:build✅ Succeeded2sView ↗
nx run generate-configs✅ Succeeded6sView ↗
Additional runs (29)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-11-26 07:06:12 UTC

returnfalse;
}
returnsymbol.flags&ts.SymbolFlags.Alias
?isSymbolTypeBased(checker.getImmediateAliasedSymbol(symbol))
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

replacegetAliasedSymbol withgetImmediateAliasedSymbol.
Because the latter can handle this case as well:

// a.tsexportconstNAME=1;exporttypeNAME=1;// b.tsimport{typeNAMEasFoo}from'./a';export{Foo};

@codecov
Copy link

codecovbot commentedNov 19, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.49%. Comparing base (17601fc) to head (3e7a944).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@##             main   #11769   +/-   ##=======================================  Coverage   90.49%   90.49%           =======================================  Files         522      522             Lines       53357    53359    +2       Branches     8909     8911    +2     =======================================+ Hits        48284    48286    +2  Misses       5057     5057             Partials       16       16
FlagCoverage Δ
unittest90.49% <100.00%> (+<0.01%)⬆️

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

Files with missing linesCoverage Δ
...eslint-plugin/src/rules/consistent-type-exports.ts96.00% <100.00%> (+0.02%)⬆️
🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks for the quick fix!

Normally we try to wait a full week for changes to give @typescript-eslint/triage-team a chance to review. But since this is a fast follow and our weekly release is in a few hours, I'd like to merge today. FYI team

ntdiary reacted with laugh emoji
@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelNov 24, 2025
@JoshuaKGoldberg
Copy link
Member

I ended up not having time to merge this in for the Monday release this week. Will leave open.

@JoshuaKGoldbergJoshuaKGoldberg merged commitbb9ba53 intotypescript-eslint:mainNov 28, 2025
65 of 66 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees

No one assigned

Labels

1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: [consistent-type-exports] Importing a shadowing type breaks consistent-type-exports

2 participants

@ntdiary@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp