0

Eslint airbnb and prettier config removes all spaces after dots in lorem ipsum text. All the other spaces remain correct. I configured .eslintrc, .prettierrc, .eslintignore, .prettierignore and .editorconfig when configuring a new react project from the template. What can be the mistake?

3 Answers3

0

Airbnb ESlint rules include no-trailing-spaces. So if you use --fix mode, linter may remove all your spaces.

More about Airbnb styles: https://github.com/airbnb/javascript

Mir
  • 104
  • 1
  • 2
  • 11
0

I managed to fix my bug in the following way: How to prevent insert spaces in JSX code . I just manually changed in VS Code Javascript to Javascript React.

0

I ended up removing prettier altogether, and I just run eslint with --fix instead, as I found prettier had styles that contradicted my .eslintrc file.

There are plug-ins for VS code that will run your eslint rules on save, similar to prettier, like this one: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

Ken Bigler
  • 587
  • 1
  • 4
  • 15