fix(jsx): consistent quotes in JSX expression (#5349)

This commit is contained in:
Ika authored and GitHub committed 2018-11-06 15:38:50 +08:00
1 parent b6691ba615
commit 40f46740f6
4 files changed
+56 -1

No files matched your search

+1 -1
View File
@@ -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 =
@@ -3865,6 +3865,12 @@ exports[`quotes.js - flow-verify 1`] = `
doubleBoth2={"\\" '"}
doubleBoth3="" ' '"
/>;
<p>
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{' '}{' '}
</p>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id="&quot;'<>&amp;quot;" />;
<div id='"&#39;<>&amp;quot;' />;
@@ -3895,6 +3901,12 @@ exports[`quotes.js - flow-verify 1`] = `
doubleBoth3="&quot; ' '"
/>;
<p>
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{" "}{" "}
</p>;
`;
exports[`quotes.js - flow-verify 2`] = `
@@ -3934,6 +3946,12 @@ exports[`quotes.js - flow-verify 2`] = `
doubleBoth2={"\\" '"}
doubleBoth3="&quot; &apos; '"
/>;
<p>
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{' '}{' '}
</p>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id='"&apos;<>&amp;quot;' />;
<div id='"&#39;<>&amp;quot;' />;
@@ -3964,6 +3982,12 @@ exports[`quotes.js - flow-verify 2`] = `
doubleBoth3="&quot; ' '"
/>;
<p>
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{" "}{" "}
</p>;
`;
exports[`quotes.js - flow-verify 3`] = `
@@ -4003,6 +4027,12 @@ exports[`quotes.js - flow-verify 3`] = `
doubleBoth2={"\\" '"}
doubleBoth3="&quot; &apos; '"
/>;
<p>
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{' '}{' '}
</p>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id="&quot;'<>&amp;quot;" />;
<div id='"&#39;<>&amp;quot;' />;
@@ -4033,6 +4063,12 @@ exports[`quotes.js - flow-verify 3`] = `
doubleBoth3="&quot; ' '"
/>;
<p>
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{' '}{' '}
</p>;
`;
exports[`quotes.js - flow-verify 4`] = `
@@ -4072,6 +4108,12 @@ exports[`quotes.js - flow-verify 4`] = `
doubleBoth2={"\\" '"}
doubleBoth3="&quot; &apos; '"
/>;
<p>
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{' '}{' '}
</p>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id='"&apos;<>&amp;quot;' />;
<div id='"&#39;<>&amp;quot;' />;
@@ -4102,6 +4144,12 @@ exports[`quotes.js - flow-verify 4`] = `
doubleBoth3="&quot; ' '"
/>;
<p>
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{' '}{' '}
</p>;
`;
exports[`return-statement.js - flow-verify 1`] = `
+6
View File
@@ -34,3 +34,9 @@
doubleBoth2={"\" '"}
doubleBoth3="&quot; &apos; '"
/>;
<p>
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{' '}{' '}
</p>
+1
View File
@@ -31,6 +31,7 @@ const ENABLED_OPTIONS = [
"semi",
"singleQuote",
"bracketSpacing",
"jsxSingleQuote",
"jsxBracketSameLine",
"arrowParens",
"trailingComma",