Opinionated Oxlint config with sensible defaults.
With Oxlint v1.46+:
npm install -D @nkzw/oxlint-config @nkzw/eslint-plugin eslint-plugin-no-only-tests eslint-plugin-perfectionist eslint-plugin-react-hooks eslint-plugin-unused-imports
Note
Due to a limitation in Oxlint's configuration resolver, you have to directly install the JS plugins for now.
In your oxlint.config.ts:
import nkzw from '@nkzw/oxlint-config';
import { defineConfig } from 'oxlint';
export default defineConfig({
extends: [nkzw],
});Then run pnpm oxlint or npm oxlint.
Use this configuration if these principles resonate with you:
- Error, Never Warn: Warnings are noise and get ignored. Either it's an issue, or it isn't. This config forces developers to fix problems or explicitly disable the rule with a comment.
- Strict, Consistent Code Style: When multiple approaches exist, this configuration enforces the strictest, most consistent code style, preferring modern language features and best practices.
- Prevent Bugs: Problematic patterns such as
instanceofare not allowed, forcing developers to choose more robust patterns. Debug-only code such asconsole.logortest.onlyare disallowed to avoid unintended logging in production or accidental CI failures. - Fast: Slow rules are avoided. For example, TypeScript's
noUnusedLocalscheck is preferred overno-unused-vars. - Don't get in the way: Subjective or overly opinionated rules (e.g. style preferences) are disabled. Autofixable rules are preferred to reduce friction and save time.
This configuration consists of the most useful and least annoying rules from the following ESlint/Oxlint plugins:
eslint-plugin-unicorneslint-plugin-import-xeslint-plugin-reacteslint-plugin-react-hookseslint-plugin-perfectionisteslint-plugin-no-instanceofeslint-plugin-no-only-tests
This configuration is meant to be used with:
- TypeScript and the
noUnusedLocalssetting - Oxfmt
If you are using ESLint, check out @nkzw/eslint-config.