Oxlint
Getting Started
Configure oxlint with shared JavaScript, TypeScript, React, and Next.js presets
@octopus-energy/oxc exports shared oxlint presets for JavaScript,
TypeScript, React, and Next.js projects.
Install dependencies
npm i -D @octopus-energy/oxc oxlint oxlint-tsgolintChoose a preset
| Export | Includes |
|---|---|
@octopus-energy/oxc/oxlint/core | Core, Import |
@octopus-energy/oxc/oxlint/typescript | Core, Import, TypeScript |
@octopus-energy/oxc/oxlint/react | Core, Import, TypeScript, React, JSX a11y |
@octopus-energy/oxc/oxlint/nextjs | Core, Import, TypeScript, React, JSX a11y, Next.js |
See the API reference for the rules included in each group.
Create an oxlint config
Create an oxlint.config.ts in your project root:
import next from "@octopus-energy/oxc/oxlint/nextjs";
import { defineConfig } from "oxlint";
export default defineConfig({
extends: [next],
ignorePatterns: ["**/node_modules/**", "**/.next/**"],
options: {
typeAware: true,
typeCheck: true,
},
env: {
builtin: true,
},
});Add package scripts
Add scripts to run oxlint locally and in CI:
{
"scripts": {
"check:lint": "oxlint",
"fix:lint": "oxlint --fix"
}
}Next steps
- Configuration for common project customizations with this package.
- API reference for the exact presets and rule groups exported by this package.
- Oxlint docs for the full upstream guide.
- CI setup to check lint rules in pull requests.