Paste escaping for Styled-Components | v2017.2

Hello there,

I recently updated to 2017.2, and it appears there is now new escaping that directly fights with styled-components "string" (tagged template literals) and the use of variables.

If I take my component here, and copy the text between the two ` characters:

const myComponent = styled.div`
padding-right: ${GUTTER_SIZE}px;
`;

and paste it again into a new component:

const myNewComponent = styled.div`
padding-right: $\{GUTTER_SIZE}px;
`;

It escapes it. This is in direct contradiction to the use-case of styled-components.

Is there anyway to disable this auto escaping? Ideally without dropping all the other features that one gets with the smart pasting (indent fixing, etc).

 

Thanks in advance,
Andrew

0
3 comments

this is a result of fixing https://youtrack.jetbrains.com/issue/WEB-7711

You can use 'Paste simple' rather than 'Paste' if you like to paste the string literal as is

0
Avatar
Permanently deleted user

Thank you Elena. I have made a request to expand on the feature added in that issue.

0
Avatar
Permanently deleted user

This was driving me nuts, thank you for the tip, Elena!

0

Please sign in to leave a comment.