xojs / xo

❤️ JavaScript/TypeScript linter (ESLint wrapper) with great defaults
MIT License
7.6k stars 285 forks source link

Better "special rules" support in Prettier mode #628

Open jonahsnider opened 2 years ago

jonahsnider commented 2 years ago

eslint-config-prettier has several "special rules" that are still useful to have enabled in ESLint, even when using Prettier as your formatter.

https://github.com/prettier/eslint-config-prettier#special-rules

Specifically, the quotes rule is what I noticed was missing which allows unnecessary backticks to get through. https://github.com/prettier/eslint-config-prettier#forbid-unnecessary-backticks

Prettier's "special rules" list should be reviewed and XO should be updated to make better use of them.

fregante commented 2 years ago

+1 I've been using this too

https://github.com/fregante/eslint-config-pixiebrix/blob/60f5a8837066009757fc293faa65636ad57fde14/index.js#L77

The only "drawback" is that it brings back the quotes lint error even for non-backtick quotes. Until now they'd just be ignored by XO/ESLint because they're handled by Prettier.