Fix lost adjacent JSX when using Babel (#6881)
Bump @babel/parser to 7.7.3. Otherwise Prettier formats "<a/><b/>" to "<a/ >;".
This commit is contained in:
1 parent
7959b12101
commit
ea70396a05
4 files changed
+17
-5
No files matched your search
+1
-1
@@ -16,7 +16,7 @@
|
||||
"dependencies": {
|
||||
"@angular/compiler": "8.2.13",
|
||||
"@babel/code-frame": "7.5.5",
|
||||
"@babel/parser": "7.7.2",
|
||||
"@babel/parser": "7.7.3",
|
||||
"@glimmer/syntax": "0.41.0",
|
||||
"@iarna/toml": "2.2.3",
|
||||
"@typescript-eslint/typescript-estree": "2.6.1",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`'Adjacent JSX' error should not be swallowed by Babel's error recovery 1`] = `
|
||||
"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (2:1)
|
||||
1 | <a></a>
|
||||
> 2 | <b></b>
|
||||
| ^"
|
||||
`;
|
||||
|
||||
exports[`html parser should handle CRLF correctly 1`] = `"\\"<!--\\\\r\\\\n test\\\\r\\\\n test\\\\r\\\\n-->\\\\r\\\\n\\""`;
|
||||
|
||||
exports[`markdown parser should handle CRLF correctly 1`] = `"\\"\`\`\`\\\\r\\\\n\\\\r\\\\n\\\\r\\\\n\`\`\`\\\\r\\\\n\\""`;
|
||||
|
||||
@@ -53,3 +53,8 @@ test("should work with foo plugin instance", () => {
|
||||
`"\\"{\\\\\\"tabWidth\\\\\\":8,\\\\\\"bracketSpacing\\\\\\":false}\\""`
|
||||
);
|
||||
});
|
||||
|
||||
test("'Adjacent JSX' error should not be swallowed by Babel's error recovery", () => {
|
||||
const input = "<a></a>\n<b></b>";
|
||||
expect(() => prettier.format(input)).toThrowErrorMatchingSnapshot();
|
||||
});
|
||||
@@ -378,10 +378,10 @@
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/parser@7.7.2", "@babel/parser@^7.1.2", "@babel/parser@^7.1.5", "@babel/parser@^7.4.5", "@babel/parser@^7.5.5", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2":
|
||||
version "7.7.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.2.tgz#ea8334dc77416bfd9473eb470fd00d8245b3943b"
|
||||
integrity sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==
|
||||
"@babel/parser@7.7.3", "@babel/parser@^7.1.2", "@babel/parser@^7.1.5", "@babel/parser@^7.4.5", "@babel/parser@^7.5.5", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2":
|
||||
version "7.7.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043"
|
||||
integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==
|
||||
|
||||
"@babel/plugin-proposal-async-generator-functions@^7.7.0":
|
||||
version "7.7.0"
|
||||
|
||||
Reference in new issue
Block a user