-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[styled-components] Adds newline in template literal #4355
Copy link
Copy link
Open
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:css/scss/lessIssues affecting CSS, Less or SCSSIssues affecting CSS, Less or SCSS
Description
Prettier 1.12.1
Playground link
Input:
const Example = styled.div`
border: 1px solid ${({active}) => active ? themeColor.active : themeColor.inactive};
`;Output:
const Example = styled.div`
border: 1px solid
${({ active }) => (active ? themeColor.active : themeColor.inactive)};
`;Expected behavior:
Prettier should not add a newline after 'solid' because it changes the resulting string. Something along these lines would be better.
const Example = styled.div`
border: 1px solid ${({active}) =>
active ? themeColor.active : themeColor.inactive
};
`;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:css/scss/lessIssues affecting CSS, Less or SCSSIssues affecting CSS, Less or SCSS