Allow .editorconfig for prettier#1153
Allow .editorconfig for prettier#1153joedevivo wants to merge 1 commit intoredhat-developer:mainfrom
Conversation
|
In the current configuration, what does this setting default to? I think it would be helpful to enable it by default, unless you think that will be annoying (if someone has configured formatting settings in an .editorconfig they probably want them respected) |
| const prettierOptions: Options = { | ||
| parser: 'yaml', | ||
| plugins: [yamlPlugin, estreePlugin], | ||
| editorConfig: options.editorConfig, |
There was a problem hiding this comment.
I don't think this works (I've tested manually in VS Code and it doesn't seem to work). I don't see editorConfig as a parameter in the documentation. To get it to work, you'll need to fetch the config for the file using https://prettier.io/docs/api#prettierresolveconfigfileurlorpath--options, then use the result from that as the config in the call to format instead of the prettierOptions defined here. (or, somehow handle merging the fetched prettier/editorconfig with what the language server has been told).
What does this PR do?
prettierwasn't respecting my.editorconfig. This PR creates an optionformat.editorConfig, and when it'strue, will pass that intoprettier, respecting those settings if you opt in.What issues does this PR fix or reference?
Is it tested? How?
Built locally, tested in neovim with
nvim-lspconfig.