Prettier removes whitespace after comma

117 Views Asked by At

I want a white space after a comma. But whenever I save the code, prettier removes the comma and white space. Is there any way to prevent prettier from removing white space ?

Expected code: tl.to('li', { opacity: 1, stagger: 1 }, );

Code I get after saving: tl.to('li', { opacity: 1, stagger: 1 });

1

There are 1 best solutions below

2
rahidt On

try adding prettier-ignore comment like below.

// prettier-ignore
tl.to('li', { opacity: 1, stagger: 1 },   );