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 isCurlyBracket and isEmptyBlock #1221

Merged
merged 1 commit into from
Apr 13, 2017
Merged

Conversation

vjeux
Copy link
Contributor

@vjeux vjeux commented Apr 13, 2017

We shouldn't be reading from the printed document but instead look at the AST. This was really easy, it can either be EmptyStatement, BlockStatement or anything else.

We shouldn't be reading from the printed document but instead look at the AST. This was really easy, it can either be EmptyStatement, BlockStatement or anything else.
const hasBraces = isCurlyBracket(con);
const isEmpty = isEmptyBlock(con);

if (hasBraces && !isEmpty) {
Copy link
Contributor Author

@vjeux vjeux Apr 13, 2017

Choose a reason for hiding this comment

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

Note that we're no longer outputting

if (1) {}
else {}

but instead

if (1) {
} else {
}

so the isEmpty condition isn't useful anymore

@jlongster
Copy link
Member

Yeah, if it works the same that's fine!

@vjeux vjeux merged commit 33fdcae into prettier:master Apr 13, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants