* Retain trailing comments in array expressions This is a proposed fix for https://github.com/babel/babel/issues/10368 with a simple test. * Move lastElement in the block where it's used * Test trailing comment after array expression * Don't move comments after the array expression * Retain trailing comment after the array expression
19 lines
230 B
JavaScript
19 lines
230 B
JavaScript
const nonTrailing = [
|
|
"One", // One
|
|
// Two
|
|
"Two" // Three
|
|
// Four
|
|
]
|
|
|
|
const trailingAfterComma = [
|
|
"One", // One
|
|
// Two
|
|
"Two", // Three
|
|
// Four
|
|
]
|
|
|
|
const trailingAfterArray = [
|
|
"One", // One
|
|
// Two
|
|
] // Three
|