Add test for comments in VariableDeclaration (#18739)
This commit is contained in:
1 parent
2d3b846607
commit
3b3f861767
3 files changed
+89
-16
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
exports[`class.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -249,7 +249,7 @@ class G4 {
|
||||
|
||||
exports[`class.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -495,7 +495,7 @@ class G4 {
|
||||
|
||||
exports[`comments.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -512,6 +512,21 @@ x;
|
||||
|
||||
[].response = response; /* comment */
|
||||
|
||||
|
||||
{
|
||||
let foo
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
{
|
||||
let foo = 42
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
let error = new Error(response.statusText)
|
||||
// comment
|
||||
@@ -525,12 +540,26 @@ x
|
||||
|
||||
;[].response = response /* comment */
|
||||
|
||||
{
|
||||
let foo
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
{
|
||||
let foo = 42
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`comments.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -546,6 +575,21 @@ x;
|
||||
|
||||
[].response = response; /* comment */
|
||||
|
||||
|
||||
{
|
||||
let foo
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
{
|
||||
let foo = 42
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
=====================================output=====================================
|
||||
let error = new Error(response.statusText);
|
||||
// comment
|
||||
@@ -559,12 +603,26 @@ x;
|
||||
|
||||
[].response = response; /* comment */
|
||||
|
||||
{
|
||||
let foo;
|
||||
|
||||
// comment
|
||||
[foo] = [1];
|
||||
}
|
||||
|
||||
{
|
||||
let foo = 42;
|
||||
|
||||
// comment
|
||||
[foo] = [1];
|
||||
}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`imports.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -625,7 +683,7 @@ export { foo as bar } // 1
|
||||
|
||||
exports[`imports.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -685,7 +743,7 @@ export { foo as bar }; // 1
|
||||
|
||||
exports[`issue-1510.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -724,7 +782,7 @@ a
|
||||
|
||||
exports[`issue-1510.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -762,7 +820,7 @@ a;
|
||||
|
||||
exports[`issue2006.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -791,7 +849,7 @@ var c = a.e
|
||||
|
||||
exports[`issue2006.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -819,7 +877,7 @@ var c = a.e;
|
||||
|
||||
exports[`no-semi.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -1003,7 +1061,7 @@ aReallyLongLine012345678901234567890123456789012345678901234567890123456789 *
|
||||
|
||||
exports[`no-semi.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@@ -1186,7 +1244,7 @@ aReallyLongLine012345678901234567890123456789012345678901234567890123456789 *
|
||||
|
||||
exports[`private-field.js - {"semi":false} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
semi: false
|
||||
| printWidth
|
||||
@@ -1207,7 +1265,7 @@ class C {
|
||||
|
||||
exports[`private-field.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow"]
|
||||
parsers: ["babel", "typescript", "flow"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
|
||||
@@ -9,3 +9,18 @@ x;
|
||||
x;
|
||||
|
||||
[].response = response; /* comment */
|
||||
|
||||
|
||||
{
|
||||
let foo
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
|
||||
{
|
||||
let foo = 42
|
||||
|
||||
// comment
|
||||
;[foo] = [1]
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
runFormatTest(import.meta, ["babel", "flow"], {});
|
||||
runFormatTest(import.meta, ["babel", "flow"], { semi: false });
|
||||
runFormatTest(import.meta, ["babel", "typescript", "flow"], {});
|
||||
runFormatTest(import.meta, ["babel", "typescript", "flow"], { semi: false });
|
||||
Reference in new issue
Block a user