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

test(eslint-plugin): [consistent-type-exports] add more shadowed imports tests#11766

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

@Tamashoo
Copy link
Contributor

PR Checklist

Overview

This PR fixes the consistent-type-exports rule to correctly handle cases where imported types are shadowed by local value definitions.

I noticed@ntdiary mentioned working on this in the issue comments. I've submitted my approach here - maintainers, please feel free to compare both solutions and choose the one that works best, or we can collaborate to combine the best aspects of each!

ntdiary reacted with laugh emoji
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@Tamashoo!

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 18, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit493c1b2
🔍 Latest deploy loghttps://app.netlify.com/projects/typescript-eslint/deploys/6929dafd3c9c1100079fa93a
😎 Deploy Previewhttps://deploy-preview-11766--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: 93 (🔴 down 5 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 18, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit493c1b2

CommandStatusDurationResult
nx test eslint-plugin --coverage=false✅ Succeeded5m 16sView ↗
nx run-many -t lint✅ Succeeded3m 14sView ↗
nx run-many -t typecheck✅ Succeeded1m 56sView ↗
nx run types:build✅ Succeeded2sView ↗
nx test eslint-plugin-internal --coverage=false✅ Succeeded2sView ↗
nx test typescript-estree --coverage=false✅ Succeeded1sView ↗
nx run integration-tests:test✅ Succeeded3sView ↗
nx run generate-configs✅ Succeeded7sView ↗
Additional runs (29)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-11-28 17:37:46 UTC

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesNov 24, 2025
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!

Though, I'm not sure what to do given#11769. I suspect we should merge this in first, as it was sent earlier (we don't have any sort of issue claiming system), and see what's left to do with#11769 after?

@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
@ntdiary
Copy link
Contributor

ntdiary commentedNov 24, 2025
edited
Loading

There are two small issues ATM :)

  1. should perform the value check during iteration, since there may be multi re-export, e.g
    // a.tsexporttypeA=1// b.tsimport{A}from'./a'constA=1export{A}// c.tsexport{A}from'./b'// false positive
  2. need to handlenamespace case, e.g
    // a.tsexporttypeA=1// b.tsimport{A}from'./a'namespaceA{exportconstb=2}export{A}

I'd personally prefer checkingSymbolFlags.Value, looks simpler and robust. However, I'm not entirely sure if it covers all cases. 😅

@Tamashoo
Copy link
ContributorAuthor

@JoshuaKGoldberg
Thank you for reviewing!
My understanding is that you only need to merge one of the pull requests.
Looking at#11769, it seems more efficient than this PR.

@ntdiary
According to your comment, should we add these test cases in this time, or in a separate one?

Thanks

JoshuaKGoldberg reacted with thumbs up emoji

@ntdiary
Copy link
Contributor

@ntdiary According to your comment, should we add these test cases in this time, or in a separate one?

Eh, for now, I don't feel strongly about adding thoseedge cases :), mainly because:

  1. the tests I added already cover the regular cases and show that the rule works well.
  2. I'm exploring@typescript/vfs, which might change how to write multi-file test (not sure how it'll turn out or whether it'll be accepted, but it seems worth trying first)

@JoshuaKGoldberg
Copy link
Member

I'll go ahead and merge#11769 tomain, as the approach is a bit more direct - then add in the added test cases from this PR.

ntdiary reacted with thumbs up emoji

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefix(eslint-plugin): [consistent-type-exports] handle shadowed imports correctlytest(eslint-plugin): [consistent-type-exports] add more shadowed imports testsNov 28, 2025
@JoshuaKGoldbergJoshuaKGoldberg merged commit16cf0f7 intotypescript-eslint:mainNov 28, 2025
67 checks passed
@codecov
Copy link

codecovbot commentedNov 28, 2025
edited
Loading

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@##             main   #11766   +/-   ##=======================================  Coverage   90.49%   90.49%           =======================================  Files         522      522             Lines       53362    53367    +5       Branches     8913     8918    +5     =======================================+ Hits        48288    48293    +5  Misses       5059     5059             Partials       15       15
FlagCoverage Δ
unittest90.49% <ø> (+<0.01%)⬆️

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

🚀 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.

@JoshuaKGoldberg
Copy link
Member

Thanks@Tamashoo@ntdiary for working on these two PRs & the good discussion around them!

ntdiary and Tamashoo reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

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

3 participants

@Tamashoo@ntdiary@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp