Architecture rules for Oxlint: files in the right folders, exports named after their file, types where they belong.
Linters catch bugs; this catches drift. Describe your folders once, and the preset wires the right rules into each one: apps, backends, libraries, UI kits and scripts. Relax a folder by changing one key, not by writing overrides.
- ποΈ Folders, not flags. Each folder says what it holds (
react,tanstack,backend,kit); nested folders inherit and refine. - π·οΈ Filename-aware. Rules derive names from the file they run on:
user-action.create.tsmust exportuserActionCreate. - ποΈ Configurable. No app names or paths baked in. Every rule works on its own too.
- π Safe autofix. π§ rules only touch whitespace or comments.
- β‘ Fast. Oxlint's JS plugin API, no extra parser.
Oxlint Β· oxlint-tsgolint Β· Bun Β· TypeScript
You need: Oxlint 1.85 or newer.
1. Install
bun add -d oxlint oxlint-tsgolint oxlint-plugin-arch
# React, Tailwind and shadcn groups (the tanstack, next, expo, react and ui recipes):
bun add -d eslint-plugin-react eslint-plugin-react-you-might-not-need-an-effect eslint-plugin-svg-jsx oxlint-tailwindcss @shadcn/lint2. Add the preset
// oxlint.config.ts
import { preset } from 'oxlint-plugin-arch/preset'
export default preset({
root: import.meta.dirname,
folders: {
'packages/ui': { react: { a11y: false } },
},
})The preset detects each workspace from its package.json (TanStack, Next, Expo, backend, UI kit, library) along with its stylesheet, # import aliases, service registry and migrations. List only the folders you want to change. To share config across projects, split it into fragments and pick them with extends: [server, tests]. Detection, inheritance, groups, recipes and templates: docs/folders.md. Locking down what one kind of file may contain: docs/files.md. Rules without the preset: docs/plugin-only.md.
3. Lint
bunx oxlintOn by default: layout, limits, style, basics, naming, comments, types, imports, tests, deny, top, externals.
Opt-in: react, tanstack, next, expo, tailwind, shadcn, kit, backend, orpc, schemas, forms, sql, effect, console.
95 rules, IDs arch/<rule>. π§ = autofix.
Also bundled: Dillon Mulroy's anti-slop rules as oxlint-plugin-arch/dillon-anti-slop.
Warning
Upgrading from 0.11 or earlier: the preset API, rule IDs and entry points changed. See the changelog.
MIT. The dillon-anti-slop rules are by Dillon Mulroy, MIT, with faster versions adapted from Christoph Nakazawa's @nkzw/oxlint-config, MIT, vendored with attribution.