-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eslint-plugin): [consistent-type-exports] check value flag before resolving alias #11769
Conversation
|
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 on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 3e7a944
☁️ Nx Cloud last updated this comment at |
| return false; | ||
| } | ||
| return symbol.flags & ts.SymbolFlags.Alias | ||
| ? isSymbolTypeBased(checker.getImmediateAliasedSymbol(symbol)) |
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.
replace getAliasedSymbol with getImmediateAliasedSymbol.
Because the latter can handle this case as well:
// a.ts
export const NAME = 1;
export type NAME = 1;
// b.ts
import { type NAME as Foo } from './a';
export { Foo };
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
JoshuaKGoldberg
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.
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
|
I ended up not having time to merge this in for the Monday release this week. Will leave open. |
bb9ba53
into
typescript-eslint:main

PR Checklist
Overview
Make sure the current symbol doesn't have
SymbolFlags.Valuebefore resolving alias.I submit the recursive version here, which is just 1 line shorter than the
whileiteration.If we prefer using iteration, can be done like this:
💖