Skip to Content
Octopus Energy Packages
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-tsgolint

Choose a preset

ExportIncludes
@octopus-energy/oxc/oxlint/coreCore, Import
@octopus-energy/oxc/oxlint/typescriptCore, Import, TypeScript
@octopus-energy/oxc/oxlint/reactCore, Import, TypeScript, React, JSX a11y
@octopus-energy/oxc/oxlint/nextjsCore, 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:

oxlint.config.ts
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:

package.json
{
  "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.

On this page