RunJS
RunJS copied to clipboard
Bug - `Pretty` code formatting bug
This Code on formatting with alt + shift + f ,
let arr = [1,2,3];
arr.indexOf(1)
let cplxArr = [
{id: 1},
{id: 2},
{id: 3}
];
cplxArr.findIndex(el => el.id === 1);
produces the following which is wrong.
let arr = [1, 2, 3];
arr.indexOf(1);
arr.indexOf(1)
let cplxArr = [{ id: 1 }, { id: 2 }, { id: 3 }];
let cplxArr = [
cplxArr.findIndex((el) => el.id === 1);
using v 2.2.2.0
Thanks @shahul01. I'm able to see the issue. It seems to be caused by the line arr.indexOf(1) not having a semi-colon.
This functionality is handled by Prettier: https://prettier.io/ I'll take a look and see if this is a known issue there.
Yeah Its the semicolon, classic.
Resolved in the latest release.