EditorConfig vs. Eslint vs. Prettier: Is it worthwhile to use them all?

In my experience, the best combination is all 3, and here’s why: EditorConfig: This helps your editor produce code that looks like your style guide as you go. While this isn’t strictly necessary in order to achieve your goals, it’s nice if you’re always looking at code that follows the same coding styles. Otherwise if … Read more

Why do I keep getting “[eslint] Delete `CR` [prettier/prettier]”?

Try setting the “endOfLine”:”auto” in your .prettierrc (or .prettierrc.json) file (inside the object) Or set ‘prettier/prettier’: [ ‘error’, { ‘endOfLine’: ‘auto’, } ] inside the rules object of the eslintrc file. If you are using windows machine endOfLine can be “crlf” basing on your git config.

What’s the difference between prettier-eslint, eslint-plugin-prettier and eslint-config-prettier?

tl;dr: Use eslint-config-prettier, you can ignore the rest. ESLint contains many rules and those that are formatting-related might conflict with Prettier, such as arrow-parens, space-before-function-paren, etc. Hence using them together will cause some issues. The following tools have been created to use ESLint and Prettier together. prettier-eslint eslint-plugin-prettier eslint-config-prettier What it is A JavaScript module … Read more

Why does Prettier not format code in VS Code?

How I’ve sorted it after having super huge frustrations with Prettier stopping working in VSCode. Select VS Code -> View -> Command Palette, and type: Format Document With Then Configure Default Formatter… and then choose Prettier – Code formatter. This sorted the problem for me magically. Depending on your case this might help you…

Why do I keep getting Delete ‘cr’ [prettier/prettier]?

Try setting the “endOfLine”:”auto” in your .prettierrc (or .prettierrc.json) file (inside the object) Or set ‘prettier/prettier’: [ ‘error’, { ‘endOfLine’: ‘auto’, } ] inside the rules object of the eslintrc file. If you are using windows machine endOfLine can be “crlf” basing on your git config.