Closed theahura closed 3 years ago
Yes, if you have prettier installed you can open a jsx file and execute :FormatCode prettier
. Although I can't vouch for how well JSX syntax is handled by the different formatters that handle JS (prettier, js-beautify, clang-format).
Vim seems to have filetype rules set up now to detect .jsx and .tsx as "javascriptreact" and "typescriptreact" filetypes, and AFAIK none of the existing formatters is associated with that filetype. You could send a pull request to associate those with some formatters' "AppliesToBuffer" checks if you believe any formatters have good support for them.
Ah, yep I needed javascriptreact, that did the trick. Thanks!
Basically the title! I couldn't figure out whether codefmt supported jsx files. The vroom test for prettier seems to suggest it does, but the README does not list this as a supported type, and I personally could not get it to work.
Thanks!