How to understand prettier parsing error better

Viewed 22

All, In the RTL test case, while running, I got the below error.

89:12 error Parsing error: Unexpected token, expected ";" prettier/prettier

But, in line 89, there is no comma.

await act(async () => {  // <-- Line 89
    user.click(closeButton);
});

How to understand this error better.

Thanks.

1 Answers

As it seems there is no comma in line 89. I believe this error you're getting is an incompatibility between the parser option and the code. According to prettier doc it automatically infers the parser from the input file path, so you shouldn’t have to change this setting.

1 - re-install prettier

2 - If you use ESLint, install eslint-config-prettier to make ESLint and Prettier play nice with each other

Related