Back to Next Js

Oxlint Example

examples/with-oxlint/README.md

16.2.51.9 KB
Original Source

Oxlint Example

This example shows how to configure Oxlint to work with a Next.js application.

Linting via Oxlint in this example includes type-aware linting through the oxlint-tsgolint integration, which is in technical preview at the time of writing.

In .oxlintrc.json, the plugins eslint, react, unicorn, typescript, nextjs, and oxc are enabled.

The first five are Rust-based Oxlint plugins that port rules from the ESLint core and the corresponding ESLint plugins.

The oxc plugin provides Oxc-specific rules along with some rules ported from Deepscan.

Further, Oxlint will not lint your .next, dist, build and node_modules directories based on the configured ignorePatterns.

Deploy your own

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

bash
npx create-next-app --example with-oxlint with-oxlint-app
bash
yarn create next-app --example with-oxlint with-oxlint-app
bash
pnpm create next-app --example with-oxlint with-oxlint-app

Linting the application

bash
npm run lint
bash
yarn lint
bash
pnpm lint

Deploy it to the cloud with Vercel (Documentation).