Skip to content

infra: migrate from eslint to oxlint#3773

Draft
Shinigami92 wants to merge 1 commit intonextfrom
chore-migrate-eslint-to-oxlint
Draft

infra: migrate from eslint to oxlint#3773
Shinigami92 wants to merge 1 commit intonextfrom
chore-migrate-eslint-to-oxlint

Conversation

@Shinigami92
Copy link
Copy Markdown
Member

@Shinigami92 Shinigami92 commented Mar 29, 2026

Summary

This PR replaces ESLint with oxlint — a much faster linter written in Rust by the oxc project.

What changed:

  • Removed 11 ESLint-related packages, added oxlint + oxlint-tsgolint (for type-aware linting)
  • Migrated all rule configurations, file overrides, and ignore patterns to oxlint.config.ts
  • Converted eslint-disable comments to oxlint-disable where the rule exists, removed them where it doesn't
  • Updated VS Code extension recommendation, devcontainer, renovate grouping, documentation, and .gitignore
  • Prettier stays as-is (runs standalone via pnpm prettier), a follow-up PR will look into oxfmt
  • Type-aware linting is enabled via oxlint-tsgolint, so rules like consistent-type-exports, restrict-plus-operands, switch-exhaustiveness-check etc. all work with full type information

Performance: The lint step in CI went from 52s (next branch) to 1s (this PR) — a 52x speedup.

Rules that are no longer enforced

Not all ESLint rules have an oxlint equivalent yet. Below is a breakdown of what we're temporarily losing, grouped by how far away support is.

Rules not yet implemented (no type info needed)

These are on the oxc roadmap but don't have a concrete timeline:

Rule What it does Tracking
logical-assignment-operators Enforce ||=, &&=, ??= Listed as TODO in oxc#479
jsdoc/require-jsdoc Require JSDoc on public API (src/**/*.ts) — this is a big one for us since it guards our public API docs Listed as TODO in oxc#1170
jsdoc/sort-tags Auto-sort JSDoc tags by our configured order (@template, @internal, @remark, @param, @returns, ...) Listed as TODO in oxc#1170
jsdoc/tag-lines Enforce blank lines between JSDoc tag groups (was off, but noting for completeness) Listed as TODO in oxc#1170

Rules not yet implemented (need type-aware linting via tsgolint)

These rules require TypeScript type information. The oxc project has a companion tool called tsgolint for this, but it currently only supports a limited set of type-aware rules. None of ours are among them yet:

Rule What it does Tracking
typescript/naming-convention Enforces our PascalCase for types/classes, T-prefix for type params convention Closed in oxc (oxc#6361) because it needs type info, open in tsgolint#186
typescript/no-mixed-enums Disallow mixing string and number members in enums No tracking issue yet — would need to be filed
typescript/no-unsafe-argument Disallow passing any to typed function params No tracking issue yet
typescript/require-await (TS version) Disallow async without await, with type-aware promise checking Base ESLint version exists (oxc#479), TS-specific not tracked yet

Intentionally dropped (not needed with oxlint)

What Why dropped
@stylistic/padding-line-between-statements Stylistic formatting concern — oxlint has no @stylistic plugin. Closed as "not planned" (oxc#11435). Will be covered by oxfmt in the future.
eslint-plugin-file-progress CI convenience only (progress bar during linting). Not needed — oxlint finishes in under a second even with type-aware linting.
eslint-plugin-prettier Prettier is now run standalone via pnpm prettier --check . in CI. This was just the bridge between ESLint and Prettier. Will be replaced by oxfmt in a future PR.

Other notes

  • test/require.spec.cts is ignored by oxlint due to a parser limitation with top-level await in .cts (CommonJS) files
  • docs/.vitepress/components/api-docs/method.vue added to ignore list — oxlint's .vue support is limited
  • cypress/ added to ignore list — separate tsconfig causes a parser error
  • Two new rules from type-aware categories (no-unsafe-type-assertion, require-array-sort-compare) are explicitly turned off since they weren't in our original ESLint config — we can evaluate enabling them separately
  • oxlint automatically respects .gitignore, so no need to duplicate those patterns in ignorePatterns

Test plan

  • pnpm run lint passes with 0 warnings and 0 errors (176 rules, type-aware enabled)
  • pnpm run test passes (51 test files, 51,621 tests)
  • CI pipeline passes — lint job in 1s vs 52s on next

@Shinigami92 Shinigami92 self-assigned this Mar 29, 2026
@Shinigami92 Shinigami92 added the c: infra Changes to our infrastructure or project setup label Mar 29, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 29, 2026

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 265aa50
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/69cada869a85730008587bd6
😎 Deploy Preview https://deploy-preview-3773.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.82%. Comparing base (94d6597) to head (265aa50).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3773      +/-   ##
==========================================
- Coverage   98.88%   98.82%   -0.07%     
==========================================
  Files         886      886              
  Lines        3061     3061              
  Branches      556      556              
==========================================
- Hits         3027     3025       -2     
- Misses         30       32       +2     
  Partials        4        4              
Files with missing lines Coverage Δ
src/internal/base64.ts 46.66% <ø> (ø)
src/internal/bind-this-to-member-functions.ts 100.00% <ø> (ø)
src/internal/deprecated.ts 100.00% <ø> (ø)
src/modules/helpers/index.ts 95.28% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Shinigami92 Shinigami92 force-pushed the chore-migrate-eslint-to-oxlint branch 2 times, most recently from afb05fb to a9fad69 Compare March 29, 2026 13:30
@Shinigami92 Shinigami92 force-pushed the chore-migrate-eslint-to-oxlint branch from a9fad69 to 265aa50 Compare March 30, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: infra Changes to our infrastructure or project setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant