oxlint-config-recommended
v1.3.0
Published
Recommended shareable config for Oxlint
Maintainers
Readme
oxlint-config-recommended
A recommended shareable configuration for Oxlint.
It enables Oxlint's correctness category as errors and suspicious category
as warnings, while covering Oxlint-supported rules from ESLint's built-in
recommended set, eslint-plugin-unicorn's recommended config, and
typescript-eslint's recommended config.
Installation
pnpm add --save-dev oxlint-config-recommended oxlintConfiguration
Basic
JSON or JSONC
Add this to .oxlintrc.json or .oxlintrc.jsonc to enable the base config:
{
"extends": ["oxlint-config-recommended"],
"env": { "builtin": true, "browser": true, "node": true, "vitest": true },
}JavaScript/TypeScript
In oxlint.config.ts (or oxlint.config.js), import the base config and add
it to the extends array:
import { defineConfig } from 'oxlint';
import recommended from 'oxlint-config-recommended';
export default defineConfig({
extends: [recommended],
env: { builtin: true, browser: true, node: true, vitest: true },
});JavaScript and TypeScript config files (including oxlint.config.js) are
experimental in Oxlint and require running Oxlint through Node.js.
React
JSON or JSONC
Add this to .oxlintrc.json or .oxlintrc.jsonc to enable the React config:
{
"extends": ["oxlint-config-recommended", "oxlint-config-recommended/react"],
"env": { "builtin": true, "browser": true, "node": true, "vitest": true },
}This enables the supported recommended rules from eslint-plugin-react.
It disables react/react-in-jsx-scope for the automatic JSX runtime used by
React 17 and later. Oxlint does not implement react/jsx-uses-react, the other
rule disabled by ESLint's plugin:react/jsx-runtime preset.
JavaScript/TypeScript
In oxlint.config.ts (or oxlint.config.js), import the base and React
configs and add them to the extends array:
import { defineConfig } from 'oxlint';
import recommended from 'oxlint-config-recommended';
import recommendedReact from 'oxlint-config-recommended/react';
export default defineConfig({
extends: [recommended, recommendedReact],
env: { builtin: true, browser: true, node: true, vitest: true },
});JSX accessibility
JSON or JSONC
Add this to .oxlintrc.json or .oxlintrc.jsonc to enable the JSX
accessibility config:
{
"extends": ["oxlint-config-recommended", "oxlint-config-recommended/jsx-a11y"],
"env": { "builtin": true, "browser": true, "node": true, "vitest": true },
}This enables the supported recommended rules from eslint-plugin-jsx-a11y.
JavaScript/TypeScript
In oxlint.config.ts (or oxlint.config.js), import the base and JSX
accessibility configs and add them to the extends array:
import { defineConfig } from 'oxlint';
import recommended from 'oxlint-config-recommended';
import recommendedJsxA11y from 'oxlint-config-recommended/jsx-a11y';
export default defineConfig({
extends: [recommended, recommendedJsxA11y],
env: { builtin: true, browser: true, node: true, vitest: true },
});Unicorn
The base configuration includes the recommended Unicorn rules. To use these rules separately:
Add this to .oxlintrc.json or .oxlintrc.jsonc to enable the Unicorn config:
{
"extends": ["oxlint-config-recommended/unicorn"],
"env": { "builtin": true, "browser": true, "node": true, "vitest": true },
}Or in oxlint.config.ts (or oxlint.config.js), import the Unicorn config and
add it to the extends array:
import { defineConfig } from 'oxlint';
import recommendedUnicorn from 'oxlint-config-recommended/unicorn';
export default defineConfig({
extends: [recommendedUnicorn],
env: { builtin: true, browser: true, node: true, vitest: true },
});Recommended rule compatibility
The supported ESLint, Unicorn, and TypeScript recommended rules remain errors
even when their Oxlint category is set to warnings. Oxlint does not currently
implement ESLint's no-dupe-args or no-octal, so those rules are omitted.
