Skip to content

chore(tooling): migrate from ESLint + Prettier to oxc ecosystem (oxlint + oxfmt)#1488

Merged
kaizhou-lab merged 3 commits intomainfrom
feat/migrate-to-oxc
Mar 19, 2026
Merged

chore(tooling): migrate from ESLint + Prettier to oxc ecosystem (oxlint + oxfmt)#1488
kaizhou-lab merged 3 commits intomainfrom
feat/migrate-to-oxc

Conversation

@loonghao
Copy link
Copy Markdown
Collaborator

Summary

Migrate the entire lint and formatting toolchain from ESLint + Prettier to the oxc ecosystem (oxlint + oxfmt).

Motivation

  • Performance: oxlint is 50-100x faster than ESLint; oxfmt is 30x faster than Prettier
  • Unified ecosystem: Both tools come from the same oxc project, ensuring consistency
  • Simpler dependency tree: Reduced from 157 ESLint/Prettier-related packages to ~84
  • Prettier-compatible: oxfmt is 97%+ compatible with Prettier output

Changes

New Files

  • .oxlintrc.json — Oxlint configuration (replaces .eslintrc.json)
  • .oxfmtrc.json — Oxfmt configuration (replaces .prettierrc.json)

Removed Files

  • .eslintrc.json
  • .eslintignore
  • .prettierrc.json
  • .prettierignore

Updated Files

  • package.json — Updated scripts (lint, lint:fix, format, format:check), replaced devDependencies, updated lint-staged config
  • .pre-commit-config.yaml — Replaced ESLint/Prettier hooks with oxlint/oxfmt hooks
  • .github/workflows/pr-checks.yml — Updated comments
  • AGENTS.md / CODE_STYLE.md — Documentation updated to reference oxlint/oxfmt
  • 103 source files — Auto-formatted by oxfmt to establish consistent baseline

Dependency Changes

Removed:

  • eslint, @typescript-eslint/eslint-plugin, @typescript-eslint/parser
  • eslint-config-prettier, eslint-plugin-prettier, eslint-plugin-import
  • prettier

Added:

  • oxlint (v1.56.0)
  • oxfmt (v0.41.0)

Verification

  • oxfmt --check passes (all files formatted)
  • oxlint runs successfully (existing code warnings preserved, no new issues)
  • ✅ Pre-commit hooks updated and compatible
  • ✅ CI workflow references updated

Migration Notes

  • oxlint rules are mapped 1:1 from the previous ESLint config
  • oxfmt options mirror the previous Prettier config (singleQuote, printWidth, etc.)
  • The 103 auto-formatted files are purely whitespace/formatting changes from oxfmt's slightly different output

…nt + oxfmt)

- Replace ESLint with oxlint (v1.56.0) for 50-100x faster linting

- Replace Prettier with oxfmt (v0.41.0) for 30x faster formatting

- Add .oxlintrc.json with equivalent rules from .eslintrc.json

- Add .oxfmtrc.json with equivalent options from .prettierrc.json

- Update package.json scripts, devDependencies, and lint-staged config

- Update .pre-commit-config.yaml hooks

- Update AGENTS.md, CODE_STYLE.md, and CI workflow references

- Remove .eslintrc.json, .eslintignore, .prettierrc.json, .prettierignore

- Auto-format all files with oxfmt for consistent baseline
- Remove useless fallback in spread patterns (|| {} / ?? {}) across 15 files

- Fix no-constant-binary-expression: comment out dead code block in WebuiModalContent

- Fix no-thenable: add eslint-disable for intentional Deferred class

- Fix no-empty-file: add eslint-disable for worker entry points

- Fix no-eval: add eslint-disable for intentional dynamic require

- Fix no-single-promise-in-promise-methods: unwrap single-element Promise.all

- Fix no-irregular-whitespace: remove BOM from ConversationSearchPopover

- Fix no-unused-expressions: clean up comma expression in test assertion

- Fix no-useless-empty-export: remove unnecessary export {} from electron.ts
@kaizhou-lab kaizhou-lab merged commit 1556d3e into main Mar 19, 2026
14 of 17 checks passed
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