Fix missing dangling comments in arrays (#744)
* Add missing dangling comments printing in arrays. * Update tests accordingly.master
parent
1affecc1a0
commit
0f34fb91eb
|
@ -814,6 +814,7 @@ function genericPrintNoParens(path, options, print) {
|
||||||
? ","
|
? ","
|
||||||
: ""
|
: ""
|
||||||
),
|
),
|
||||||
|
comments.printDanglingComments(path, options, /* sameIndent */ true),
|
||||||
softline,
|
softline,
|
||||||
"]"
|
"]"
|
||||||
])
|
])
|
||||||
|
|
|
@ -94,12 +94,16 @@ exports[`test dangling_array.js 1`] = `
|
||||||
"expect(() => {}).toTriggerReadyStateChanges([
|
"expect(() => {}).toTriggerReadyStateChanges([
|
||||||
// Nothing.
|
// Nothing.
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
[1 /* first comment */, 2 /* second comment */, 3];
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
expect(() => {}).toTriggerReadyStateChanges(
|
expect(() => {}).toTriggerReadyStateChanges(
|
||||||
[
|
[
|
||||||
// Nothing.
|
// Nothing.
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[1 /* first comment */, 2 /* second comment */, 3];
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -107,12 +111,16 @@ exports[`test dangling_array.js 2`] = `
|
||||||
"expect(() => {}).toTriggerReadyStateChanges([
|
"expect(() => {}).toTriggerReadyStateChanges([
|
||||||
// Nothing.
|
// Nothing.
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
[1 /* first comment */, 2 /* second comment */, 3];
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
expect(() => {}).toTriggerReadyStateChanges(
|
expect(() => {}).toTriggerReadyStateChanges(
|
||||||
[
|
[
|
||||||
// Nothing.
|
// Nothing.
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[1 /* first comment */, 2 /* second comment */, 3];
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
expect(() => {}).toTriggerReadyStateChanges([
|
expect(() => {}).toTriggerReadyStateChanges([
|
||||||
// Nothing.
|
// Nothing.
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
[1 /* first comment */, 2 /* second comment */, 3];
|
||||||
|
|
Loading…
Reference in New Issue