You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to configure prettier so it's the default formatter for everything unless a different formatter was configured. If prettier does not format a file I would like the lsp to.
Currently the lsp is preffered over the ["_"] filetype which i would consider to be counterintuitive.
What is the significance of this feature?
nice to have
Additional details
Obviously I could just configure prettier for every file but that feels pretty annoying and verbose for the config
The text was updated successfully, but these errors were encountered:
If prettier does not format a file I would like the lsp to.
I assume that by this you mean that you want to attempt to run prettier and, if it does not format the file, fall back to LSP. Conform doesn't do this kind of logic because it would require parsing errors from the formatters to determine if they failed because the file isn't supported or for some other reason. Better to just let the user configure the formatters they want for the filetypes they want.
If the current syntax doesn't support exactly what you need, I recommend writing your own function to define what formatters to use. You can do that on a per-filetype basis like we do in this example, or you can do it for all filetypes by defining a custom format-on-save function like we do here. In any case, you have to decide which formatters to use ahead of time. The fallback behavior is only for situations where a formatter is not installed, or the LSP is not available, or a formatter has a condition that returns false.
Did you check existing requests?
Describe the feature
Prefer
["_"]
filetype over lsp format.Provide background
I want to configure prettier so it's the default formatter for everything unless a different formatter was configured. If prettier does not format a file I would like the lsp to.
Currently the lsp is preffered over the
["_"]
filetype which i would consider to be counterintuitive.What is the significance of this feature?
nice to have
Additional details
Obviously I could just configure prettier for every file but that feels pretty annoying and verbose for the config
The text was updated successfully, but these errors were encountered: