Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to override requireConfig if the command is explicitly called #3602

Open
jasonwilliams opened this issue Jan 14, 2025 · 0 comments
Open

Comments

@jasonwilliams
Copy link

jasonwilliams commented Jan 14, 2025

Is your feature request related to a problem? Please describe.
I navigate many codebases and sometimes hitting save runs prettier automatically which isn't what I've intended. To get around this I've set prettier.requireConfig: true. This will at least only run prettier if the codebase is setup for prettier and helps a lot.

However, sometimes I do want to format something, and running "Format with..." -> "Prettier" does nothing, because the config is set to prettier.requireConfig: true. But in this case I explicitly want to format the document (or selection). It is annoying having to toggle requireConfig back and forth.

Describe the solution you'd like
I would like "format on save" to continue to respect the requireConfig flag, but running the format command should still format (as I've explicitly called that function)

Describe alternatives you've considered
Another alternative could be a separate command for overriding the formatting, but i don't think that will work, as VS Code seems to already have a way of calling prettier's "format" command. I think instead (if we don't want to break backwards compatibility) we would need a setting to allow override if the command is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant