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(utils): addTSDeclareFunction tofunctionTypeTypes#9788

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

@abrahamguo
Copy link
Contributor

@abrahamguoabrahamguo commentedAug 13, 2024
edited
Loading

PR Checklist

Overview

Fromb47b88f,TSDeclareFunction was missing fromfunctionTypeTypes.

@typescript-eslint
Copy link
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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedAug 13, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit5a425ff
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/66bc0f23758a9500075674c3
😎 Deploy Previewhttps://deploy-preview-9788--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: 98 (🔴 down 2 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 yourNetlify site configuration.

@nx-cloud
Copy link

nx-cloudbot commentedAug 13, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit5a425ff. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 fromNxCloud.

@abrahamguoabrahamguo changed the titlebug(utils): addTSDeclareFunction tofunctionTypeTypesfix(utils): addTSDeclareFunction tofunctionTypeTypesAug 13, 2024
@kirkwaiblinger
Copy link
Member

Would you mind filing an issue for this and/or fleshing out the description with the PR that this change is fixing up? The commit referenced says it's not on a branch within this repo, so it's hard to figure out what this is in reference to

@kirkwaiblingerkirkwaiblinger added awaiting responseIssues waiting for a reply from the OP or another party please fill out the templatewe have the processes for good reasons 😔 labelsAug 13, 2024
@abrahamguo
Copy link
ContributorAuthor

Yep, sorry! This came from#9479.

I agree with@auvred, I will add some unit tests to validate this change.

kirkwaiblinger reacted with thumbs up emoji

@github-actionsgithub-actionsbot removed the awaiting responseIssues waiting for a reply from the OP or another party labelAug 14, 2024
@abrahamguo
Copy link
ContributorAuthor

Inno-redundant-type-constituents,never is not allowed in unions.
However, an exception is for function return types, where itis allowed in unions.
BecauseTSDeclareFunction was missing fromfunctionTypeTypes, the rule wronglydid report forTSDeclareFunctions but not other function types, as shown in@auvred's example:

declare function fn(): never | 'foo' // wrongly reportstype ffn = () => never | 'foo'

In this PR, it now correctly recognizesTSDeclareFunction as a function type, and now no longer reports.

return!!(
node.parent.type===AST_NODE_TYPES.TSTypeAnnotation&&
(isFunctionType(node.parent.parent)||isFunction(node.parent.parent))
isFunctionOrFunctionType(node.parent.parent)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

isFunctionOrFunctionType simply combines the checks of the two functions into one

@auvredauvred added 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge and removed please fill out the templatewe have the processes for good reasons 😔 labelsAug 24, 2024
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 cleanup! 🙌

@JoshuaKGoldbergJoshuaKGoldberg merged commit6377f18 intotypescript-eslint:mainAug 24, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsSep 1, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

@auvredauvredauvred 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.

4 participants

@abrahamguo@kirkwaiblinger@JoshuaKGoldberg@auvred

[8]ページ先頭

©2009-2025 Movatter.jp