@qntx/oxfmt
v2.0.0
Published
Shareable Oxfmt config for Vite+ apps and TypeScript libraries
Maintainers
Readme
@qntx/oxfmt
Shareable Oxfmt config for Vite+ apps and TypeScript libraries. printWidth: 100, double quotes, semicolons, sortImports on. Formatting lives here; lint does not own style. **/bun.lock is ignored — bun rewrites it.
Install
bun add -d @qntx/oxlint @qntx/oxfmtDo not add oxfmt to a Vite+ app — vp already nests it. Requires Vite+ 1.4.0 or later (oxfmt >=0.74.0 <1.0.0).
Usage
Vite+ React
import { defineConfig } from "vite-plus";
import { fmt } from "@qntx/oxfmt";
import { react } from "@qntx/oxlint";
export default defineConfig({
lint: react,
fmt,
});Library: { lint: config, fmt }. Overlay with spread: { ...fmt, printWidth: 120 }.
Extend object-valued settings (sortImports, sortPackageJson, sortTailwindcss) by spreading the nested object — they are typed as the objects the preset ships, so no narrowing is needed:
export default {
...fmt,
sortImports: {
...fmt.sortImports,
internalPattern: [...fmt.sortImports.internalPattern, "@app/"],
},
};CLI
// oxfmt.config.ts
export { fmt as default } from "@qntx/oxfmt";Vite+ projects should put format in vite.config.ts, not oxfmt.config.ts.
License
Licensed under the MIT License (LICENSE or https://opensource.org/licenses/MIT).
A QuantX open-source project.
Code is law. We write both.
