@nelsonlaidev/oxlint-config
v1.0.1
Published
Nelson Lai's oxlint config preset
Readme
@nelsonlaidev/oxlint-config
Personal Oxlint configurations for Nelson Lai projects.
This package is synced from eslint-config and aims to enable every supported Oxlint rule that is also enabled in eslint-config.
Installation
npm i -D @nelsonlaidev/oxlint-config oxlint oxlint-tsgolintoxlint-tsgolint is optional — it enables type-aware linting rules. Omit it if you set typeAware: false in your config.
Some presets use Oxlint jsPlugins. These are declared as peer dependencies and most modern package managers (npm >=7, pnpm, yarn) install them automatically. Only run the command below if your package manager does not auto-install peers:
npm i -D @nelsonlaidev/eslint-plugin @stylistic/eslint-plugin eslint-plugin-command eslint-plugin-de-morgan eslint-plugin-import-zod eslint-plugin-regexp eslint-plugin-simple-import-sort eslint-plugin-sonarjsCreate an oxlint.config.ts file with the following content:
import { defineConfig } from '@nelsonlaidev/oxlint-config'
export default defineConfig()Optional presets are explicit Oxlint overrides. Add only the presets your project uses:
import { defineConfig, nextjs, playwright, react, tailwindcss, vitest } from '@nelsonlaidev/oxlint-config'
export default defineConfig({
settings: {
'better-tailwindcss': {
entryPoint: './src/globals.css',
},
},
overrides: [
react(),
nextjs(),
tailwindcss(),
vitest({
files: ['**/*.test.ts'],
}),
playwright({
files: ['e2e/**/*.spec.ts'],
}),
],
})Each preset accepts a native Oxlint override object. Use it to replace files, add plugins, or override rules:
export default defineConfig({
ignorePatterns: ['generated/**'],
overrides: [
react({
files: ['src/**/*.{js,jsx,ts,tsx}'],
rules: {
'@eslint-react/no-array-index-key': 'off',
},
}),
{
files: ['scripts/**/*.ts'],
rules: {
'eslint/no-console': 'off',
},
},
],
})Notes
This package follows eslint-config as the source of truth. When a rule is enabled there, we enable the corresponding Oxlint rule here when Oxlint supports it.
What's Included
This config includes opinionated rules from the following plugins:
Always enabled
oxceslintcommandtypescriptunicornpromisenodejsx-a11yimportjsdocnelsonlaidevstylisticde-morganzodregexpsonarjsimport-sort
Optional presets
reactnextjsvitestplaywrighttailwindcss
Migration Status
Sync Summary
| Preset | Synced | Dropped | Classified | Unclassified | Coverage |
| ------------------------------------------------- | -----: | ------: | ---------: | -----------: | -------: |
| command/nelsonlaidev/command/rules | 1 | 0 | 0 | 0 | 100.0% |
| de-morgan/nelsonlaidev/de-morgan/rules | 2 | 0 | 0 | 0 | 100.0% |
| eslint/nelsonlaidev/javascript/rules | 93 | 2 | 2 | 0 | 100.0% |
| import-sort/nelsonlaidev/import-sort/rules | 2 | 0 | 0 | 0 | 100.0% |
| imports/nelsonlaidev/import-x/rules | 20 | 6 | 6 | 0 | 84.6% |
| jsdoc/nelsonlaidev/jsdoc/rules | 2 | 0 | 0 | 0 | 100.0% |
| jsx-a11y/nelsonlaidev/jsx-a11y/rules | 35 | 1 | 1 | 0 | 100.0% |
| nelsonlaidev/nelsonlaidev/nelsonlaidev/rules | 5 | 0 | 0 | 0 | 100.0% |
| nextjs/nelsonlaidev/nextjs/rules | 21 | 0 | 0 | 0 | 100.0% |
| node/nelsonlaidev/node/rules | 2 | 4 | 4 | 0 | 50.0% |
| playwright/nelsonlaidev/playwright/rules | 36 | 0 | 0 | 0 | 100.0% |
| promise/nelsonlaidev/promise/rules | 16 | 1 | 1 | 0 | 100.0% |
| react/nelsonlaidev/react/rules | 99 | 2 | 2 | 0 | 100.0% |
| regexp/nelsonlaidev/regexp/rules | 67 | 0 | 0 | 0 | 100.0% |
| sonarjs/nelsonlaidev/sonarjs/rules | 279 | 0 | 0 | 0 | 100.0% |
| stylistic/nelsonlaidev/stylistic/rules | 1 | 0 | 0 | 0 | 100.0% |
| tailwindcss/nelsonlaidev/tailwindcss/rules | 9 | 0 | 0 | 0 | 100.0% |
| typescript/nelsonlaidev/typescript/rules | 117 | 21 | 21 | 0 | 100.0% |
| typescript/nelsonlaidev/typescript/declarations | 2 | 0 | 0 | 0 | 100.0% |
| unicorn/nelsonlaidev/unicorn/rules | 136 | 193 | 193 | 0 | 41.6% |
| vitest/nelsonlaidev/vitest/rules | 20 | 0 | 0 | 0 | 100.0% |
| zod/nelsonlaidev/zod/rules | 1 | 0 | 0 | 0 | 100.0% |
Unclassified Dropped Rules
No unclassified dropped rules.
Configs Not Migrated
| Config | Reason |
| ------------------- | --------------------------------------------------------------- |
| comments.ts | Plugin that comments out eslint-disable directives |
| gitignore.ts | File-based ignores, handled by Oxlint config |
| ignores.ts | File ignore patterns |
| prettier.ts | Formatting concern, handled by oxfmt |
| unused-imports.ts | Replaced by Oxlint built-in no-unused-vars with fix.imports |
