-
Notifications
You must be signed in to change notification settings - Fork 660
📎 Support prettier-style jsx quotes #4486
Comments
I agree, this started reformatting all our JSX, which was not optimal. |
As an alternative name: |
what is the status of this? wanted to update to version 12, but this is blocking us |
I could take it to implement🤗 |
This don't work as expected.
const App = () => {
const stringVar = '123'; // quoteStyle single
return <div id="xxx" />; // jsxQuoteStyle double
}
const App = () => {
const stringVar = "123"; // jsxQuoteStyle double, quoteStyle single would be useless here
return <div id="xxx" />; // jsxQuoteStyle double
} |
This feature hasn't been released yet, but it works as expected: https://docs.rome.tools/playground/?quoteStyle=single&code=YwBvAG4AcwB0ACAAQQBwAHAAIAA9ACAAKAApACAAPQA%2BACAAewAKACAAIABjAG8AbgBzAHQAIABzAHQAcgBpAG4AZwBWAGEAcgAgAD0AIAAnADEAMgAzACcAOwAgAC8ALwAgAHEAdQBvAHQAZQBTAHQAeQBsAGUAIABzAGkAbgBnAGwAZQAKACAAIAByAGUAdAB1AHIAbgAgADwAZABpAHYAIABpAGQAPQAiAHgAeAB4ACIAIAAvAD4AOwAgAC8ALwAgAGoAcwB4AFEAdQBvAHQAZQBTAHQAeQBsAGUAIABkAG8AdQBiAGwAZQAKAH0A You would need to use a nightly release to avail of the feature. |
Description
Since Rome 12.1.0, Rome started enforcing the same quote style on JSX prop strings.
This breaks parity with prettier: with
"singleQuote": true
prettier would still format JSX strings with double-quotes.Playground example
Straying away from prettier as the "standard" makes it a hard pill to swallow as projects would have to reformat the majority of their files.
Possible approaches:
"jsxQuoteStyle": "double" / "single"
,"double"
by default.I think it's a fairly safe option to add as it wouldn't affect the formatting of other parts of the code, it'd only change the quote characters and quote escaping in the strings.
Previous discussion: #4469
The text was updated successfully, but these errors were encountered: