prettier/prettier-emacs

Prettier with spacemacs and js files.

cinjon opened this issue · 0 comments

Hi, I am trying to use prettier with spacemacs and .js files that have jsx blocks in them. Notably, if I change the extension to .jsx, then it is applying Prettier (and is notifying me as such with the "Prettier" tag on the bottom of the screen). However, it is not applying to jsx blocks in .js files. How do I fix this? In my user-config, I have this:

(add-hook 'js2-mode-hook 'prettier-js-mode)
(add-hook 'js2-jsx-mode-hook 'prettier-js-mode)
(add-hook 'web-mode-hook 'prettier-js-mode)
(add-hook 'react-mode-hook 'prettier-js-mode)
(push '("\\.js\\'" . react-mode) auto-mode-alist)