Prettier config for Emacs

Prettier is a code formatter for mainly Javascript mixed with CSS, JSX and so on.

prettier.el is its binding for Emacs.
Spacemacs’s Typescript layer also uses perttier.el under the hood.

Note that prettier itself need to be installed separatedly. See the Installation of prettier.el.

Config for Emacs

If you want to change prettier options, prettier-js-args in .emacs is for you.

  (setq prettier-js-args '(
               "--tab-width" "4"))

You can supply prettier-js-args with prettier CLI options.

⁋ Sep 22, 2022↻ Dec 18, 2024
中馬崇尋
Chuma Takahiro