• Applicable Software: General
  • Min Version Number: 00.01.00
  • Max Version Number: Not Applicable

Steps

  1. Open your user or workspace settings.json.
  2. Add:
    "editor.defaultFormatter": "mokoconsulting.mokoformat",
    "editor.formatOnSave": true
  3. That's it — MokoFormat registers for JS/TS, HTML, CSS/SCSS/LESS, JSON/JSONC, Markdown, YAML and PHP, routing each to the right engine (Prettier for web, php-cs-fixer/phpcbf for PHP).

Why this is needed

VS Code only has one global editor.defaultFormatter, so you normally have to set a different formatter per language. MokoFormat is a single formatter that dispatches internally, so one setting covers the whole stack. Prettier still honours a project .prettierrc.

Part of the Moko VS Code suite.