A mix format plugin that formats JavaScript and TypeScript files with oxfmt.
Setup
Add Volt.Formatter to your .formatter.exs:
[
plugins: [Volt.Formatter],
inputs: [
"{mix,.formatter}.exs",
"{config,lib,test}/**/*.{ex,exs}",
"assets/**/*.{js,ts,jsx,tsx}"
]
]Configuration
Set oxfmt options under the :volt key of the same file:
[
plugins: [Volt.Formatter],
volt: [semi: false, single_quote: true, print_width: 100]
]Without that key, options come from .oxfmtrc.json / .prettierrc.json.
See the "Formatting and Linting" guide for details.