@setemiojo/oxlint-config
v0.1.6
Published
Shareable OXC toolchain config for oxlint and oxfmt
Readme
@setemiojo/oxlint-config
Shareable oxlint + oxfmt config for the OXC toolchain.
- Reasonable defaults, best practices, only one line of config
- Auto-detects TypeScript and React — zero config for most projects
- Composable presets:
base,typescript,react,node,testing,next,tanstackRouter - Optional oxfmt formatter preset — single quotes, no semi, trailing commas, sorted imports
- Requires oxlint ≥ 1.0.0
[!WARNING] This is a personal config with strong opinions. Changes may not suit every project or team.
If you use this config directly, review changes every time you update. Or fork it and maintain your own.
Usage
Starter Wizard
Run the CLI to set up oxlint and oxfmt in your project with one command:
pnpm dlx @setemiojo/oxlint-config@latestThe wizard will:
- Auto-detect installed packages (TypeScript, React, etc.) and pre-select the right presets
- Write
oxlint.config.tsusingsetemiojo() - Write
oxfmt.config.tsor.oxfmtrc.jsonfor the formatter - Add
lint:oxandformat:oxscripts topackage.json
Manual Install
pnpm i -D oxlint @setemiojo/oxlint-configCreate oxlint.config.ts in your project root:
// oxlint.config.ts
import { setemiojo } from '@setemiojo/oxlint-config'
import { defineConfig } from 'oxlint'
export default defineConfig(setemiojo())Add scripts to package.json
{
"scripts": {
"lint:ox": "oxlint .",
"lint:ox:fix": "oxlint . --fix"
}
}IDE Support
Install the oxc VS Code extension.
Add the following to your .vscode/settings.json:
{
// Enable oxlint
"oxc.enable": true,
// Auto-fix on save
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit"
}
}Install the oxc Zed extension.
Add the following to your .zed/settings.json:
{
"code_actions_on_format": {
"source.fixAll.oxc": true
}
}Customization
Auto-detection
setemiojo() auto-detects your project's installed packages and enables the right presets:
| Detected package | Preset enabled |
|---|---|
| typescript | typescript |
| react, react-dom, @tanstack/react-router, @tanstack/start | react |
All other presets are opt-in:
// oxlint.config.ts
import { setemiojo } from '@setemiojo/oxlint-config'
import { defineConfig } from 'oxlint'
export default defineConfig(setemiojo({
// explicitly override auto-detection
typescript: true,
react: true,
// opt-in extras
node: true,
testing: true,
next: true,
tanstackRouter: true,
}))Presets
You can also import individual presets and compose them manually:
// oxlint.config.ts
import { base, react, typescript, node } from '@setemiojo/oxlint-config'
import { defineConfig } from 'oxlint'
export default defineConfig({
extends: [
...base,
...typescript,
...react,
...node,
],
})Check out the configs and factory for more details.
React
React support is automatically detected when any of the following packages are installed:
react/react-dom@tanstack/react-router/@tanstack/start
Or explicitly enable it:
export default defineConfig(setemiojo({ react: true }))Node.js
export default defineConfig(setemiojo({ node: true }))Testing
Enables rules for test files (vitest, jest):
export default defineConfig(setemiojo({ testing: true }))Next.js
export default defineConfig(setemiojo({ next: true }))TanStack Router
Requires the optional peer dependency @tanstack/eslint-plugin-router:
pnpm i -D @tanstack/eslint-plugin-routerexport default defineConfig(setemiojo({ tanstackRouter: true }))oxfmt
Install the formatter:
pnpm i -D oxfmtWith oxfmt.config.ts (Node ≥ 22.18)
// oxfmt.config.ts
import { oxfmt } from '@setemiojo/oxlint-config/oxfmt'
export default oxfmt()With .oxfmtrc.json
node -e "const {oxfmt}=await import('@setemiojo/oxlint-config/oxfmt');const fs=await import('node:fs');fs.writeFileSync('.oxfmtrc.json',JSON.stringify(oxfmt(),null,2)+'\\n')"Customize formatter options
import { oxfmt } from '@setemiojo/oxlint-config/oxfmt'
export default oxfmt({
printWidth: 120,
singleQuote: false,
semi: true,
trailingComma: 'es5',
sortImports: true,
})Default options:
| Option | Default |
|---|---|
| printWidth | 100 |
| tabWidth | 2 |
| useTabs | false |
| semi | false |
| singleQuote | true |
| trailingComma | "all" |
| insertFinalNewline | true |
| sortImports | false |
| sortPackageJson | true |
Add scripts to package.json
{
"scripts": {
"format:ox": "oxfmt .",
"format:ox:check": "oxfmt . --check"
}
}Versioning Policy
This project follows Semantic Versioning. However, since this is a config with opinions, rule changes are not treated as breaking changes.
Breaking changes
- Node.js version requirement changes
- oxlint major version bumps that affect config shape
- Removal of exported presets or factory options
Non-breaking changes
- Enabling or tightening rules within a preset
- Rule option changes
- Dependency version bumps
FAQ
Why oxlint instead of ESLint?
oxlint is 50–100× faster than ESLint. For large codebases, the difference is seconds vs. minutes. It covers the most important correctness and suspicious rules with zero plugin setup.
Why oxfmt instead of Prettier?
oxfmt is built on OXC's Rust parser — significantly faster than Prettier's JS parser. It intentionally stays close to Prettier's output so migration is easy.
Can I use this alongside ESLint?
Yes. oxlint and ESLint target different things and don't conflict. oxlint is a fast first pass for correctness rules; ESLint handles complex type-aware and stylistic rules.
Check Also
- oluwasetemi/eslint-config — ESLint flat config (TypeScript, React, Vue, and more)
- oluwasetemi/dotfiles — My dotfiles
- oxc-project/oxc — The OXC toolchain
License
MIT License © 2026-PRESENT Oluwasetemi Ojo
