简体   繁体   中英

Eslint airbnb and prettier config removes all spaces after dots in text

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?

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM