Skip to content
Zap Studio
oxfmt
Esc
navigateopen⌘Jpreview
On this page

Getting Started

Install @zap-studio/oxfmt and configure the base or Tailwind preset.

Installation

npm install --save-dev @zap-studio/oxfmt oxfmt
yarn add -D @zap-studio/oxfmt oxfmt
pnpm add -D @zap-studio/oxfmt oxfmt
bun add -D @zap-studio/oxfmt oxfmt
deno add -D npm:@zap-studio/oxfmt npm:oxfmt

oxfmt 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,
});

Last updated on September 13, 2026

Was this page helpful?