@jabworks/oxfmt-config
v0.2.2
Published
Opinionated oxfmt formatter configuration, ported from @jabworks/prettier-config
Maintainers
Readme
@jabworks/oxfmt-config
Opinionated oxfmt configuration, ported from @jabworks/prettier-config.
Installation
npm install -D oxfmt @jabworks/oxfmt-configUsage
Because oxfmt does not support extends in config files, consumers import the shared config directly in oxfmt.config.ts:
// oxfmt.config.ts
import { config } from '@jabworks/oxfmt-config';
export default config;To extend or override settings:
// oxfmt.config.ts
import { config } from '@jabworks/oxfmt-config';
import { defineConfig } from 'oxfmt';
export default defineConfig({ ...config, printWidth: 80 });Note:
oxfmt.config.tsrequires Node.js v22.18+ or v24+.
Config
| Option | Value | Notes |
| ------------------------ | ------------- | ------------------------------------------------------ |
| printWidth | 120 | |
| tabWidth | 2 | |
| useTabs | false | |
| semi | true | |
| singleQuote | true | |
| jsxSingleQuote | true | |
| quoteProps | "as-needed" | |
| trailingComma | "all" | |
| bracketSpacing | true | |
| bracketSameLine | false | |
| arrowParens | "avoid" | |
| endOfLine | "lf" | |
| singleAttributePerLine | true | |
| sortImports | true | Built-in import sorting for the oxlint+oxfmt toolchain |
| sortPackageJson | true | Built-in; replaces prettier-plugin-packagejson |
| sortTailwindcss | true | Built-in; replaces prettier-plugin-tailwindcss |
Differences from @jabworks/prettier-config
- No general JSON sorting — oxfmt has no equivalent to
prettier-plugin-sort-jsonfor arbitrary JSON files. Onlypackage.jsonis sorted (viasortPackageJson). Keep Prettier for*.jsonif sorted JSON matters to you. - Import sorting is oxfmt's, not simple-import-sort's —
sortImportsis enabled so the oxlint+oxfmt toolchain sorts imports at all (oxlint has nosimple-import-sortport), but the resulting order differs from the ESLint toolchain's custom groups. sortPackageJsonandsortTailwindcssare built-in — no plugins to install.- Long unions break differently. When a union type (of string literals, object types, or anything else) fits on one
line after a break at
=, Prettier keeps it there, and oxfmt puts one member per line. Seen on oxfmt 0.60 and 0.70, so it is not a regression. oxfmtis still in beta — API may change before a stable release.
React Native / Expo
The config needs nothing React Native specific:
- Native folders are skipped. oxfmt honors
.gitignore, and Expo's default one already coversandroid/,ios/, and.expo/. experimentalOperatorPosition(new in oxfmt 0.70) defaults to"end", the same as Prettier, so it is left unset.sortTailwindcssdoes nothing in a project without Tailwind. With NativeWind it is untested.
Migrating an app from @jabworks/prettier-config: expect the first oxfmt run to touch most files that import anything,
because it sorts imports, and to sort package.json. Beyond that, the output matches Prettier's except for the union
difference above, so the migration diff is mostly import order.
