-
-
Notifications
You must be signed in to change notification settings - Fork 877
Closed
Copy link
Labels
A-formatterArea - FormatterArea - FormatterA-formatter-prettier-diffArea - Formatter difference with PrettierArea - Formatter difference with Prettier
Description
Input
import styled from 'styled-components';
const Example = styled.div`
content: '\\201C';
`;
export default Example;Config
Oxfmt output
Oxfmt version: 0.37
import styled from 'styled-components';
const Example = styled.div`
content: '\\\\201C';
`;
export default Example;Oxfmt playground link
No response
Prettier output
Prettier version: 3.8.1
import styled from 'styled-components';
const Example = styled.div`
content: '\\201C';
`;
export default Example;Prettier playground link
No response
Additional notes
oxfmt escapes already escaped backslashes inside css or styled template strings. Reruning oxfmt keeps adding more and more backslashes to the file.
Unable to reproduce in the Oxc playground.
$ yarn oxfmt --version
Version: 0.37.0
$ cat test.jsx
import styled from 'styled-components';
const Example = styled.div`
content: '\\201C';
`;
$ yarn oxfmt test.jsx
Finished in 144ms on 1 files using 12 threads.
$ cat test.jsx
import styled from 'styled-components';
const Example = styled.div`
content: '\\\\201C';
`;
export default Example;
$ yarn oxfmt test.jsx
Finished in 144ms on 1 files using 12 threads.
cat test.jsx
import styled from 'styled-components';
const Example = styled.div`
content: '\\\\\\\\201C';
`;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-formatterArea - FormatterArea - FormatterA-formatter-prettier-diffArea - Formatter difference with PrettierArea - Formatter difference with Prettier
{ "ignorePatterns": ["node_modules/**", "vendor/**", "dist/**", "config/**"], "singleAttributePerLine": false, "singleQuote": true, "sortImports": { "internalPattern": ["@guuru/"], "newlinesBetween": false, "groups": [ ["side_effect"], ["builtin"], ["external", "type-external"], ["internal", "type-internal"], ["parent", "type-parent"], ["sibling", "type-sibling"], ["index", "type-index"] ] } }