diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 722bfde02..998d9dd7b 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -5297,7 +5297,7 @@ function printJSXElement(path, options, print) { containsMultipleAttributes || containsMultipleExpressions; - const rawJsxWhitespace = options.jsxSingleQuote ? "{' '}" : '{" "}'; + const rawJsxWhitespace = options.singleQuote ? "{' '}" : '{" "}'; const jsxWhitespace = ifBreak(concat([rawJsxWhitespace, softline]), " "); const isFacebookTranslationTag = diff --git a/tests/jsx/__snapshots__/jsfmt.spec.js.snap b/tests/jsx/__snapshots__/jsfmt.spec.js.snap index 491a2f6d2..c01fe3f14 100644 --- a/tests/jsx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx/__snapshots__/jsfmt.spec.js.snap @@ -3865,6 +3865,12 @@ exports[`quotes.js - flow-verify 1`] = ` doubleBoth2={"\\" '"} doubleBoth3="" ' '" />; + +
+ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; @@ -3895,6 +3901,12 @@ exports[`quotes.js - flow-verify 1`] = ` doubleBoth3="" ' '" />; ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{" "}{" "} +
; + `; exports[`quotes.js - flow-verify 2`] = ` @@ -3934,6 +3946,12 @@ exports[`quotes.js - flow-verify 2`] = ` doubleBoth2={"\\" '"} doubleBoth3="" ' '" />; + ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; @@ -3964,6 +3982,12 @@ exports[`quotes.js - flow-verify 2`] = ` doubleBoth3="" ' '" />; ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{" "}{" "} +
; + `; exports[`quotes.js - flow-verify 3`] = ` @@ -4003,6 +4027,12 @@ exports[`quotes.js - flow-verify 3`] = ` doubleBoth2={"\\" '"} doubleBoth3="" ' '" />; + ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; @@ -4033,6 +4063,12 @@ exports[`quotes.js - flow-verify 3`] = ` doubleBoth3="" ' '" />; ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
; + `; exports[`quotes.js - flow-verify 4`] = ` @@ -4072,6 +4108,12 @@ exports[`quotes.js - flow-verify 4`] = ` doubleBoth2={"\\" '"} doubleBoth3="" ' '" />; + ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; @@ -4102,6 +4144,12 @@ exports[`quotes.js - flow-verify 4`] = ` doubleBoth3="" ' '" />; ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
; + `; exports[`return-statement.js - flow-verify 1`] = ` diff --git a/tests/jsx/quotes.js b/tests/jsx/quotes.js index 6982466fe..a4f6090b8 100644 --- a/tests/jsx/quotes.js +++ b/tests/jsx/quotes.js @@ -34,3 +34,9 @@ doubleBoth2={"\" '"} doubleBoth3="" ' '" />; + ++ GitHub Desktop has encountered an unrecoverable error and will need to 1231231 + restart. This has been reported to the team, but if youencounter this121312331 + repeatedly please report this issue to the GitHub 12312312312312313{' '}{' '} +
diff --git a/website/playground/Playground.js b/website/playground/Playground.js index 621a1d5ad..a08a2d047 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -31,6 +31,7 @@ const ENABLED_OPTIONS = [ "semi", "singleQuote", "bracketSpacing", + "jsxSingleQuote", "jsxBracketSameLine", "arrowParens", "trailingComma",