Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

arrow-return-shorthand: Improve failure message when return expression is an object literal #2466

Merged
merged 2 commits into from
Apr 3, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

Overview of change:

Changes the failure message to mention that parentheses are needed when the expression is an object literal.

function hasComments(node: ts.Node): boolean {
return ts.getTrailingCommentRanges(text, node.getEnd()) !== undefined;
}
function hasComments(node: ts.Node): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a function called hasCommentAfterPosition in src/language/utils.ts which does basically the same and will also handle leading trivia of the next token

@adidahiya adidahiya merged commit aaf6f54 into palantir:master Apr 3, 2017
@andy-hanson andy-hanson deleted the arrow-return-shorthand branch April 3, 2017 04:45
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.

3 participants