-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Ugly formatting of ternary inside a TS as assertion #8840
Copy link
Copy link
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-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.
Description
Prettier 2.0.5
Playground link
# Options (if any):
--parser=typescriptInput:
{ { {
const inputExample = (callNode.parent?.type === AST_NODE_TYPES.ChainExpression ? callNode.parent.parent : callNode.parent) as TSESTree.BinaryExpression
} } }Output:
{
{
{
const inputExample = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent) as TSESTree.BinaryExpression;
}
}
}Expected behavior:
{
{
{
const expectedOutput1 = (
callNode.parent?.type === AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent
) as TSESTree.BinaryExpression;
const expectedOutput2 = (callNode.parent?.type ===
AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent) as TSESTree.BinaryExpression;
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-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.