An opinionated, production-ready Oxlint configuration for TypeScript and React projects. Requires oxlint >= 1.51.0.
pnpm add -D @fdhl/oxlint-config oxlint
# or
npm install --save-dev @fdhl/oxlint-config oxlintCreate oxlint.config.js in your project root:
import config from "@fdhl/oxlint-config";
export default config;Run the linter:
npx oxlint .| Plugin | Purpose |
|---|---|
typescript |
TypeScript-specific rules |
unicorn |
Modern JS best practices |
react |
React and React DOM rules |
node |
Node.js best practices |
import |
Import consistency and ordering |
| Plugin | Purpose |
|---|---|
eslint-plugin-perfectionist |
Sorted imports, exports, named items |
eslint-plugin-react-hooks |
Rules of hooks, exhaustive deps |
eslint-plugin-unused-imports |
Auto-remove unused imports and vars |
eslint-plugin-no-only-tests |
Prevent .only in test files |
- Explicit Opt-in Rules — Oxlint's
correctnesscategory is disabled; only hand-picked rules are enabled, so you know exactly what's enforced - TypeScript-aware — Bans
@ts-ignore, prevents unsafe type patterns, enforcesprefer-as-const - Modern JS — ES2024+, prefers
at(),includes(),structuredClone(), node protocol imports - React Best Practices — Blocks legacy APIs (
findDOMNode,dangerouslySetInnerHTML), enforces hooks rules - Import Hygiene — Sorted imports/exports, no duplicates, unused imports auto-removed
- Developer UX — Blocks
@nocommittags and.onlytests from reaching production
Install the Oxlint VS Code extension, then add to .vscode/settings.json:
{
"oxc.enable": true
}MIT