@yunarch/eslint-oxlint-diff
v0.4.1
Published
CLI tool to compare ESLint and OxLint rules, showing coverage gaps and overlap.
Readme
CLI tool to compare ESLint and OxLint rules, showing coverage gaps and overlap.
Why?
Thinking about adopting Oxlint? This tool rapidly answers:
- How much of my ESLint config does Oxlint already cover? See a coverage percentage at a glance.
- Which rules are missing? Get a list of ESLint rules not covered by your Oxlint config, grouped by plugin.
- Which new Oxlint rules will I get? Spot extra rules Oxlint enables that your ESLint config doesn't have.
[!NOTE] If you just want to migrate from ESLint to OxLint, you should check out
Oxlint migration guide.
Usage
Usage: @yunarch/eslint-oxlint-diff [options]
CLI tool to compare ESLint and OxLint rules, showing coverage gaps and overlap.
Options:
-V, --version output the version number
--eslint-config <path> Path to the ESLint configuration file. Defaults
to eslint.config file in the current directory.
--oxlint-config <path> Path to the oxlint configuration file. If
omitted, infers the config from the ESLint
configuration.
--verbose Print the full per-rule listings of ESLint-only
and OxLint-only rules in addition to the
summary. (default: false)
--with-infer-type-aware Include type-aware rules when inferring the
oxlint config. Only relevant without
--oxlint-config. (default: true)
--with-infer-js-plugins Include ESLint JS plugins when inferring the
oxlint config. Only relevant without
--oxlint-config. (default: false)
--with-infer-nursery Include nursery rules when inferring the oxlint
config. Only relevant without --oxlint-config.
(default: false)
--save-inferred-oxlint <path> Save the inferred OxLint config to a file. Only
relevant without --oxlint-config.
-h, --help display help for command
Quick start:
$ npx @yunarch/eslint-oxlint-diff
With inferred OxLint config:
$ npx @yunarch/eslint-oxlint-diff --with-infer-type-aware --with-infer-js-plugins
With explicit config paths:
$ npx @yunarch/eslint-oxlint-diff --eslint-config path/to/eslint.config --oxlint-config path/to/.oxlintrcExample output
┌────────────────────┬───────────────┬───────────────┬──────────────────────────────┐
│ ESLint plugin │ OxLint plugin │ Covered rules │ Coverage │
├────────────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ @typescript-eslint │ typescript │ 5 / 7 │ ██████████████░░░░░░ 71% │
├────────────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ eslint │ eslint │ 3 / 4 │ ███████████████░░░░░ 75% │
└────────────────────┴───────────────┴───────────────┴──────────────────────────────┘
Total active ESLint rules: 11
Total active OxLint rules: 8
Covered by OxLint: 8
ESLint-only (not in OxLint): 3
OxLint-only (not in ESLint): 0
OxLint coverage of ESLint rules: 72.73%With --verbose, uncovered ESLint rules and OxLint-only rules are listed inline:
┌─────────────────────────────────────────────────────┬───────────────┬───────────────┬──────────────────────────────┐
│ ESLint plugin │ OxLint plugin │ Covered rules │ Coverage │
├─────────────────────────────────────────────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ @typescript-eslint │ typescript │ 5 / 7 │ ██████████████░░░░░░ 71% │
│ ├─ @typescript-eslint/consistent-type-imports │ │ │ │
│ ├─ @typescript-eslint/no-import-type-side-effects │ │ │ │
├─────────────────────────────────────────────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ eslint │ eslint │ 3 / 4 │ ███████████████░░░░░ 75% │
│ ├─ no-console │ │ │ │
└─────────────────────────────────────────────────────┴───────────────┴───────────────┴──────────────────────────────┘Key concepts
- Inference mode (default): When
--oxlint-configis not provided, the tool uses@oxlint/migrateto automatically generate an equivalent OxLint configuration from your ESLint flat config. --save-inferred-oxlint: Exports the inferred OxLint config to a JSON file, useful as a starting point for your own.oxlintrc.json.
Programmatic API
The package also exports the core functions for use in other tools:
import { diff, printDiffResult } from '@yunarch/eslint-oxlint-diff';
const result = diff(eslintFlatConfigs, oxlintConfig);
// result.eslintOnly - rules active in ESLint but not OxLint
// result.coveredByOxlint - rules active in both
// result.oxlintOnly - rules active in OxLint but not ESLint
printDiffResult(result, { verbose: true }); // prints formatted output to console📜 License
MIT License © 2026-Present @yunarch
