prettier: comments in array literal changes index if undefined
Prettier 2.0.4 Playground link
--parser babel
Input:
const data = [ /*0**/,1 /*1**/]
Output:
const data = [, /*0**/ 1 /*1**/];
Expected behavior:
const data = [/*0**/,1 /*1**/]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (17 by maintainers)
This is not a duplicate. This issue is about holes in array literals, not about destructuring.