Skip to content

fix(visitor-keys): reorder TSSatisfiesExpression and TSTypeAssertion - #10139

Merged
bradzacher merged 3 commits into
typescript-eslint:mainfrom
abrahamguo:visitor-keys-satisfies
Oct 14, 2024
Merged

bradzacher merged 3 commits into
typescript-eslint:mainfrom
abrahamguo:visitor-keys-satisfies

Conversation

@abrahamguo

Copy link
Copy Markdown
Contributor

PR Checklist

Overview

@typescript-eslint

Copy link
Copy Markdown
Contributor

Thanks for the PR, @abrahamguo!

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.

@netlify

netlify Bot commented Oct 12, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 77753c4
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/670c7639f5002800084ae97f
😎 Deploy Preview https://deploy-preview-10139--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: 100 (🟢 up 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (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 your Netlify site configuration.

@nx-cloud

nx-cloud Bot commented Oct 12, 2024 •

Copy link
Copy Markdown

TSQualifiedName: ['left', 'right'],
TSReadonlyKeyword: [],
TSRestType: ['typeAnnotation'],
TSSatisfiesExpression: [

@kirkwaiblinger kirkwaiblinger Oct 12, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just noting for the record that it looks like this was set up this way from the start in #5717. The erroneous/misleading comment was added in #5926 with no particular comment. There isn't any discussion of the visitor key order in #5688 either.

Just saying this all to do due diligence to investigate whether there was any particular reason in the paper trail that it was set up that way in the first place, but it doesn't seem there is (see @bradzacher's comment eslint/eslint#19002 (comment))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't remember why I did this.
It was probably a cock up and I copied TSTypeAssertion rather than TSAsExpression.

If no tests fail then I assume it was defs just a bug 🤷

TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'],
TSTypeAnnotation: ['typeAnnotation'],
TSTypeAssertion: SharedVisitorKeys.TypeAssertion,
// this is intentionally different to SharedVisitorKeys.AsExpression because

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally I don't think this comment is necessary, and would be better omitted (especially considering the previous incarnation of it was wrong). But it's not important one way or another 🤷‍♂️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's remove it

kirkwaiblinger
kirkwaiblinger previously approved these changes Oct 12, 2024
@kirkwaiblinger kirkwaiblinger added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Oct 12, 2024
TSTupleType: ['elementTypes'],
TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'],
TSTypeAnnotation: ['typeAnnotation'],
TSTypeAssertion: SharedVisitorKeys.TypeAssertion,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@codecov

codecov Bot commented Oct 14, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.14%. Comparing base (ef8642b) to head (77753c4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10139   +/-   ##
=======================================
  Coverage   86.14%   86.14%           
=======================================
  Files         428      428           
  Lines       14981    14981           
  Branches     4344     4344           
=======================================
  Hits        12905    12905           
  Misses       1730     1730           
  Partials      346      346           
Flag Coverage Δ
unittest 86.14% <ø> (ø)

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

Files with missing lines Coverage Δ
packages/visitor-keys/src/visitor-keys.ts 100.00% <ø> (ø)

@github-actions github-actions Bot removed the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Oct 14, 2024
@bradzacher

Copy link
Copy Markdown
Member

Thanks heaps!

@kirkwaiblinger kirkwaiblinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍👍

@bradzacher
bradzacher merged commit c48f7dc into typescript-eslint:main Oct 14, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: [no-useless-assignment] False positive in code using satisfies

3 participants