prettier-emacs
prettier-emacs copied to clipboard
Prettier not formatting typescript file
Hi
I have the following setting
(add-hook 'typescript-mode-hook 'prettier-js-mode)
but on save nothing happens.
thanks
I have same issue, @aoshi321 you can fix that by adding a after-save-hook
on your typescript emacs config.
Example :
(use-package typescript-mode
:straight t
:mode ("\\.tsx?\\'" . typescript-mode)
:config
(setq typescript-indent-level 2)
(add-hook 'flycheck-mode-hook #'sopho/use-eslint-from-node-modules)
(add-hook 'after-after-hook #'prettier-js-mode)) ; format file with prettier on save
(use-package prettier-js
:straight t
:commands (prettier-js-mode prettier-js)
:hook ((typescript-mode . prettier-js-mode)))