Skip to content
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

Remove needless conditions for YeildExpression in needs-parens #13790

Merged
merged 1 commit into from Nov 6, 2022

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Nov 4, 2022

Description

I tried to address #13783 (comment).
Then I noticed some conditions are not actually used.

I'll backport this PR to main after merge this into next.

Checklist

Try the playground for this PR

Comment on lines -353 to -356
parent.type === "UnaryExpression" ||
parent.type === "AwaitExpression" ||
parent.type === "TSAsExpression" ||
parent.type === "TSNonNullExpression"
Copy link
Member Author

Choose a reason for hiding this comment

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

UnaryExpression, TSAsExpression and TSNonNullExpression are treated on https://github.com/prettier/prettier/blob/next/src/language-js/needs-parens.js#L368-L370 so this change no affects for format result.

@sosukesuzuki sosukesuzuki marked this pull request as ready for review November 4, 2022 12:05
Copy link
Member

@kachkaev kachkaev left a comment

Choose a reason for hiding this comment

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

Approving based on passed CI

@sosukesuzuki sosukesuzuki merged commit fb55c39 into prettier:next Nov 6, 2022
@sosukesuzuki sosukesuzuki deleted the follow-up-satisfies branch November 6, 2022 05:06
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants