@zhangyu1818/oxlint-config
v1.0.0
Published
Native Oxlint and Oxfmt config preset package
Downloads
87
Maintainers
Readme
@zhangyu1818/oxlint-config
Native oxlint + oxfmt presets for JavaScript and TypeScript projects.
Core presets in this package use functionality implemented natively in Oxc. The reactAgentRules preset is backed by an Oxlint JS plugin that ships with this package and auto-enables when react is installed.
Installation
pnpm add -D @zhangyu1818/oxlint-config oxlint oxlint-tsgolint oxfmtOxlint
Create oxlint.config.ts:
import { defineConfig } from '@zhangyu1818/oxlint-config'
export default defineConfig({
presets: {
node: true,
react: true,
test: true,
typescript: true,
},
})Available presets:
ignoresimportsjavascriptnodereactreactAgentRulesnexttesttypescriptunicorn
Default line limits:
- source files:
300 - component files (
*.jsx,*.tsx,*.mtsx,*.ctsx):200 - test files:
500
react preset options:
react: {
options: {
a11y: true,
framework: {
next: true,
vite: false,
},
},
}reactAgentRules adds the bundled react-agent-rules JS plugin preset and applies:
react-agent-rules/no-manual-memoizationreact-agent-rules/no-forward-refreact-agent-rules/effect-empty-deps-only
export default defineConfig({
presets: {
react: true,
},
})Oxfmt
Create oxfmt.config.ts:
import { defineOxfmtConfig } from '@zhangyu1818/oxlint-config'
export default defineOxfmtConfig({
presets: {
imports: true,
packageJson: true,
tailwindcss: false,
},
})Default formatter options:
semi: falsesingleQuote: truetabWidth: 2useTabs: falseprintWidth: 80endOfLine: 'lf'
Scripts
{
"scripts": {
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"format": "oxfmt -c oxfmt.config.ts .",
"format:check": "oxfmt --check -c oxfmt.config.ts ."
}
}Migration Notes
This migration keeps 264 native rules and drops 139 rules from the previous ESLint-based package.
Exports
defineConfigdefineOxlintConfigdefineOxfmtConfigdefaultIgnorePatternsdefaultSortImports
