-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Invalid indentation: return (foo ? bar1 : bar2).baz() #4976
Copy link
Copy link
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Description
Prettier 1.14.2
Playground link
--parser babylon
--tab-width 4Input:
const decorated = ((arg, ignoreRequestError) => {
return (
typeof arg === 'string' ||
(arg && arg.valueOf && typeof arg.valueOf() === 'string')
? $delegate(arg, ignoreRequestError)
: handleAsyncOperations(arg, ignoreRequestError)
).foo();
});Output:
const decorated = (arg, ignoreRequestError) => {
return (typeof arg === "string" ||
(arg && arg.valueOf && typeof arg.valueOf() === "string")
? $delegate(arg, ignoreRequestError)
: handleAsyncOperations(arg, ignoreRequestError)
).foo();
};Expected behavior:
Correct indentation after return.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken