prettier-vscode
prettier-vscode copied to clipboard
RFC: support conditional activation
trafficstars
Is your feature request related to a problem? Please describe.
I use different formatters for js/ts in different projects, but the prettier extension activation is so wide that it formats code in other projects too, undesireably (standard, biome, etc)
Describe the solution you'd like
After activation, check for conditions that imply I want prettier formatting. Lightweight, quick checks. Race for...
- presence of any prettier config files
- presence in package.json
Describe alternatives you've considered
What I have to do now is globally turn off the relevant extension and reload my editor every time i open the relevant project, such that I get the desired dev experience (e.g. format on save).
Additional context
- https://github.com/prettier/prettier-vscode/issues/2561
- https://github.com/biomejs/biome-vscode/discussions/72
- https://github.com/microsoft/vscode/issues/188638