-1

In vscode I use eslint for linting and prettier for formatting vanilla javascript, but after having fixed things that eslint flags I go to save and then prettier reformats back to what eslint was complaining about.

40:6   error  There must be a space after this paren        space-in-parens
40:20  error  There must be a space before this paren       space-in-parens
42:5   error  Strings must use singlequote                  quotes
45:2   error  There must be a space before this paren       space-in-parens

✖ 61 problems (61 errors, 0 warnings)
  61 errors and 0 warnings potentially fixable with the `--fix` option.

Should I configure eslint to work according to prettiers rules or vice versa?

pastic
  • 531
  • 2
  • 5
  • 12
  • 1
    Consider using eslint-config-prettier: https://github.com/prettier/eslint-config-prettier. It is mentioned in Prettier docs as a recommended way to avoid possible conflicts between ESLint and Prettier: https://prettier.io/docs/en/integrating-with-linters.html. – Dmitry VS Aug 26 '23 at 09:03
  • 1
    Prettier is for formatting, eslint is for enforcing code style. You can configure eslint with prettier using the link mentioned in the comment above. – Yousaf Aug 26 '23 at 09:07

0 Answers0