vscode-styled-components
vscode-styled-components copied to clipboard
Doesn't work if more lines after "styled"
@adamzalesak Can you follow the template and include the code with the screenshot?
The issue is because )
is on a new line.
I think we will need a new rule where /styled($/
is at the end of a line, followed by typescript arguments, followed by )`
followed by styles followed by `
Feel free to contribute, I can help along the way
Also doesn't work if styled()
is wrapping an inline component (that likely takes more than 1 line):
const StyledComponent = styled(() => {
return <div>Hello world!</div>;
})`
color: red;
`;

I believe this is the same issue.
It's the same issue if typed "properties" extend across multiple lines:
const InputWrapper = styled.div<{
disabled: boolean;
}>`
display: flex;
`;
Edit: This is already covered in the contribute info file: https://github.com/styled-components/vscode-styled-components/blob/master/CONTRIBUTING.md#a-line-break-seems-to-break-the-syntax-highlighting