Skip to content

fix(typescript): properly chain when there is a TSNonNullExpression#4005

Merged
duailibe merged 4 commits intoprettier:masterfrom
ericanderson:fix-non-null-chain
Feb 20, 2018
Merged

fix(typescript): properly chain when there is a TSNonNullExpression#4005
duailibe merged 4 commits intoprettier:masterfrom
ericanderson:fix-non-null-chain

Conversation

@ericanderson
Copy link
Copy Markdown
Contributor

Fixes #3999

When encountering a TSNonNullExpression, don't abort the chain. Just include it with the current group.

Comment thread src/language-js/printer-estree.js Outdated
return concat(["::", path.call(print, "callee")]);
}

function printNonNullExpression() {
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.

Why did you abstract this out?

@ericanderson
Copy link
Copy Markdown
Contributor Author

It seemed like when things were done more than once, they were abstracted. More than happy to just use a string literal.

@j-f1
Copy link
Copy Markdown
Member

j-f1 commented Feb 20, 2018

I think that’s a better idea, given that this is just "!", not something more complicated.

Copy link
Copy Markdown
Member

@azz azz left a comment

Choose a reason for hiding this comment

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

I'd also prefer to inline "!" if there's only two occurrences. Otherwise lgtm!

@duailibe duailibe merged commit 051a488 into prettier:master Feb 20, 2018
@duailibe
Copy link
Copy Markdown
Collaborator

Thanks for contributing! 🎉

@duailibe duailibe modified the milestone: 1.11 Feb 20, 2018
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 18, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 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.

4 participants