Getting Started
Install @zap-studio/oxfmt and configure the base or Tailwind preset.
Installation
npm install --save-dev @zap-studio/oxfmt oxfmtyarn add -D @zap-studio/oxfmt oxfmtpnpm add -D @zap-studio/oxfmt oxfmtbun add -D @zap-studio/oxfmt oxfmtdeno add -D npm:@zap-studio/oxfmt npm:oxfmtoxfmt is a peer dependency — install the version you want to run.
Base Config
// oxfmt.config.ts
import { defineConfig } from "oxfmt";
import zapStudio from "@zap-studio/oxfmt/base";
export default defineConfig(zapStudio);
This sorts imports into groups and sorts package.json keys and scripts alphabetically. See Presets for the exact group order.
Tailwind CSS Projects
Swap in the tailwind preset — it extends base with sortTailwindcss: true:
import { defineConfig } from "oxfmt";
import zapStudio from "@zap-studio/oxfmt/tailwind";
export default defineConfig(zapStudio);
Override an Option
Unlike oxlint.config.ts, oxfmt’s config has no extends merge — the preset is a plain object, so override or add options with a spread:
import { defineConfig } from "oxfmt";
import zapStudio from "@zap-studio/oxfmt/base";
export default defineConfig({
...zapStudio,
printWidth: 120,
});