Skip to content

Migrate linting from ESLint to oxlint#2986

Merged
bk201- merged 8 commits intomainfrom
dev/dshilov/migrate-to-oxlint
Apr 20, 2026
Merged

Migrate linting from ESLint to oxlint#2986
bk201- merged 8 commits intomainfrom
dev/dshilov/migrate-to-oxlint

Conversation

@bk201-
Copy link
Copy Markdown
Contributor

@bk201- bk201- commented Apr 16, 2026

Migrate linting from ESLint to oxlint

Summary

Replaces the majority of ESLint rules with oxlint — a Rust-based linter that is 50–100× faster than ESLint. ESLint is kept only for a single rule (no-restricted-syntax with AST node selectors) that oxlint does not yet support.


Why oxlint?

ESLint (before) oxlint + ESLint (after)
Lint time ~40s ~6s + ~2s = ~8s
Rules checked ~80 87
Plugin coverage TypeScript, React, jsx-a11y, react-perf, Jest, Mocha, import, promise, license-header

The speed gain comes from oxlint running all rules in parallel across 22 threads in a single Rust binary — no Node.js startup, no type-aware graph traversal for most rules.


Changes

New: .oxlintrc.json

Full oxlint configuration with:

  • Categories: correctness (error, default) + suspicious (warn) + perf (warn)
  • Plugins: import, promise, react-perf
  • jsPlugins: eslint-plugin-license-header, eslint-plugin-mocha (loaded natively by oxlint)
  • Per-file overrides: TypeScript rules for *.ts/*.tsx, Jest for unit tests, Mocha for integration tests
  • Only rules that deviate from defaults are listed explicitly — config is ~230 lines instead of the ~400 lines of the initial migration draft

Updated: eslint.config.mjs

Reduced from ~270 lines to ~60 lines. The only remaining rule:

'no-restricted-syntax': ['error', ...]  // enforces @vscode/l10n import convention via AST selectors

bk201- added 2 commits April 16, 2026 16:35
- Add .oxlintrc.json with full rule set:
  correctness (error), suspicious (warn), perf (warn)
  TypeScript, React, jsx-a11y, react-perf, Jest, Mocha plugins
  license-header enforced via jsPlugins
  promise plugin for async/await patterns
- Slim down eslint.config.mjs to a single rule:
  no-restricted-syntax (AST selectors for @vscode/l10n import guard)
  TypeScript parser kept so ESLint can parse .ts/.tsx files
- Install oxlint + eslint-plugin-oxlint devDependencies
- Update lint/lint-fix scripts: oxlint runs first, then eslint
- Remove stale eslint-disable comments from source files
  (rules migrated to oxlint no longer need inline suppressions)
- Add oxlint-disable comment in test/global.test.ts
  for intentional top-level mocha hook
Remove ~170 lines of explicit 'error' rules that are already enabled
automatically by oxlint's default correctness category:
- Top-level rules: removed all 55 Default=Γ standard ESLint correctness
  rules (constructor-super, no-debugger, no-unused-labels, etc.)
- TS/TSX overrides: removed 10 TypeScript Default=Γ rules
  (no-duplicate-enum-values, no-misused-new, no-this-alias,
   no-wrapper-object-types, prefer-as-const, triple-slash-reference,
   no-extra-non-null-assertion, no-non-null-asserted-optional-chain,
   no-unsafe-declaration-merging, prefer-namespace-keyword)
- Removed no-unused-expressions (Default=Γ correctness)
- Removed no-op 'off' entries for Pedantic rules that aren't enabled
  (no-throw-literal, prefer-promise-reject-errors, require-await)
Config shrinks from ~400 to ~230 lines. Rule count unchanged: 87 rules.
@bk201- bk201- requested a review from a team as a code owner April 16, 2026 14:55
bk201- added 6 commits April 16, 2026 17:42
The lint script was calling oxlint but the package was missing from
devDependencies, causing CI to fail with 'oxlint: not found' since
npm ci only installs declared dependencies.
- Install oxlint-tsgolint package (required for typeAware option)
- Add options.typeAware: true to .oxlintrc.json
- Add type-aware rules for *.ts and *.tsx:
    no-floating-promises (error), no-misused-promises (error),
    require-await (warn), unbound-method (warn), no-base-to-string (warn)
- Disable type-aware rules for test files (jest/mocha overrides)
- Revert eslint.config.mjs to truly minimal (no-restricted-syntax only)
Type-aware mode adds only ~1.5s overhead (8s -> 9.4s) thanks to
oxlint-tsgolint's Rust-based type resolution.
@bk201- bk201- merged commit 0352cbe into main Apr 20, 2026
5 checks passed
@bk201- bk201- deleted the dev/dshilov/migrate-to-oxlint branch April 20, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants