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-imports] dont report on types used in export assignment expressions#8332

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
bradzacher merged 2 commits intotypescript-eslint:mainfromauvred:fix/8330
Feb 1, 2024

Conversation

auvred
Copy link
Member

PR Checklist

Overview

I missed that in#8265 :

In cases likeexport = {} as T, T was referenced asisTypeReference: true andisValueReference: true. Now it's only referenced as a type

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@auvred!

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 commentedFeb 1, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitde9754f
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65bb6a0bf5a88d0008a3099c
😎 Deploy Previewhttps://deploy-preview-8332--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: 87 (🔴 down 3 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.

@codecovCodecov
Copy link

codecovbot commentedFeb 1, 2024
edited
Loading

Codecov Report

Attention:2 lines in your changes are missing coverage. Please review.

Comparison is base(d805516) 87.71% compared to head(de9754f) 87.70%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #8332      +/-   ##==========================================- Coverage   87.71%   87.70%   -0.02%==========================================  Files         397      397                Lines       13948    13950       +2       Branches     4054     4055       +1     ==========================================  Hits        12235    12235- Misses       1401     1403       +2  Partials      312      312
FlagCoverage Δ
unittest87.70% <66.66%> (-0.02%)⬇️

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

FilesCoverage Δ
...eslint-plugin/src/rules/consistent-type-imports.ts95.28% <ø> (ø)
...ages/scope-manager/src/referencer/ExportVisitor.ts90.90% <100.00%> (-0.76%)⬇️
...ackages/scope-manager/src/referencer/Referencer.ts95.56% <100.00%> (+0.03%)⬆️
...internal/src/rules/no-typescript-default-import.ts88.23% <0.00%> (-11.77%)⬇️

Copy link
Member

@bradzacherbradzacher left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thanks for hopping on this so fast!

I believe here should be no change required to the rule here - just a fix to the scope analysis. The tests are correct to add though!

Given the export equals declaration accepts an expression - we don't want to drop down into the export visitor. We just need a special case for the one special case - the identifier case. All other cases can be handled as a normal expression would.

In the identifier case we can immediately create a dual-reference. We know it's just this case because bothT[U] andT.U are semantic errors from TS ifT is a type, orT.U is a type (any syntactically those are the two valid ways to "chain" off a type reference).

auvred reacted with heart emoji
Copy link
Member

@bradzacherbradzacher left a comment
edited
Loading

Choose a reason for hiding this comment

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

brilliant - thanks!

auvred reacted with heart emoji
@bradzacherbradzacher merged commit8de6ee2 intotypescript-eslint:mainFeb 1, 2024
@bradzacherbradzacher added the bugSomething isn't working labelFeb 1, 2024
danvk pushed a commit to danvk/typescript-eslint that referenced this pull requestFeb 4, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 9, 2024
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
bugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [consistent-type-imports] erroneous report on type used in anexport = assertion
2 participants
@auvred@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp