Skip to content

chore: replace eslint with oxlint#4678

Open
escapedcat wants to merge 5 commits intomasterfrom
chore/replace-eslint-with-oxlint
Open

chore: replace eslint with oxlint#4678
escapedcat wants to merge 5 commits intomasterfrom
chore/replace-eslint-with-oxlint

Conversation

@escapedcat
Copy link
Copy Markdown
Member

Replace ESLint and 10 related dependencies with oxlint for significantly faster linting (70ms vs seconds). All existing lint rules are mapped to their oxlint equivalents in .oxlintrc.json.

Replace ESLint and 10 related dependencies with oxlint for significantly
faster linting (70ms vs seconds). All existing lint rules are mapped to
their oxlint equivalents in .oxlintrc.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Replace ESLint with oxlint for faster linting

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Replace ESLint with oxlint for significantly faster linting
• Migrate all lint rules to .oxlintrc.json configuration
• Remove 10 ESLint-related dependencies from devDependencies
• Update lint scripts and lint-staged configuration
Diagram
flowchart LR
  ESLint["ESLint + 10 dependencies"]
  Oxlint["Oxlint single dependency"]
  Config["eslint.config.mjs"]
  NewConfig[".oxlintrc.json"]
  Scripts["package.json scripts"]
  
  ESLint -- "replaced by" --> Oxlint
  Config -- "replaced by" --> NewConfig
  Scripts -- "updated to use" --> Oxlint
Loading

Grey Divider

File Changes

1. .oxlintrc.json ⚙️ Configuration changes +47/-0

New oxlint configuration file

• New oxlint configuration file with schema reference
• Defines ignore patterns for lib, coverage, node_modules, fixtures, dist
• Configures plugins for typescript, import, and vitest
• Maps all ESLint rules to oxlint equivalents with appropriate severity levels
• Includes overrides for test files to disable import/first rule

.oxlintrc.json


2. eslint.config.mjs ⚙️ Configuration changes +0/-104

Remove ESLint configuration file

• Entire file removed as part of ESLint replacement
• Contained 104 lines of ESLint configuration with multiple plugins and presets
• Configuration logic replaced by simpler .oxlintrc.json format

eslint.config.mjs


3. package.json Dependencies +8/-13

Replace ESLint with oxlint in dependencies

• Update lint scripts to use oxlint instead of eslint
• Add oxlint to lint-staged configuration for TypeScript and JavaScript files
• Remove 10 ESLint-related devDependencies (@eslint/eslintrc, @eslint/js,
 @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vitest/eslint-plugin,
 eslint-plugin-import-x, eslint-config-prettier, eslint-import-resolver-typescript, globals)
• Add oxlint ^1.58.0 as single replacement dependency
• Add packageManager specification for yarn

package.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 1, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Advisory comments

1. Unresolvable $schema path 🐞 Bug ⚙ Maintainability
Description
.oxlintrc.json references a JSON schema under ./node_modules/oxlint/..., but node_modules is
gitignored, so IDEs/tools attempting to resolve $schema in a fresh clone will fail schema
validation until dependencies are installed.
Code

.oxlintrc.json[R1-3]

+{
+  "$schema": "./node_modules/oxlint/configuration_schema.json",
+  "ignorePatterns": [
Evidence
The config hard-codes a schema path into node_modules, and the repo explicitly ignores
node_modules, so the schema file cannot exist in-repo and won’t resolve prior to yarn install.

.oxlintrc.json[1-3]
.gitignore[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.oxlintrc.json` uses `"$schema": "./node_modules/oxlint/configuration_schema.json"`, but `node_modules` is not committed (gitignored). This breaks JSON-schema-based validation/autocomplete in tools that try to resolve `$schema` before dependencies are installed.
### Issue Context
This does **not** break `oxlint` execution itself, but it can cause editor warnings/errors and loss of schema validation on fresh checkouts.
### Fix Focus Areas
- .oxlintrc.json[1-3]
- .gitignore[1-6]
### Suggested fix
Either:
1) Remove the `$schema` field, or
2) Point `$schema` to a schema file that exists in-repo (e.g., vendored under a `schemas/` directory), or
3) If your project is okay with remote schemas, point `$schema` to a stable URL that editors can fetch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Apr 1, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repo’s linting workflow from ESLint to oxlint to reduce lint runtime, replacing the ESLint configuration and dependencies with an .oxlintrc.json-based setup.

Changes:

  • Replace lint / lint-fix scripts to use oxlint, and run oxlint --fix via lint-staged for *.{ts,js}.
  • Remove the existing eslint.config.mjs flat-config and introduce .oxlintrc.json.
  • Update dependencies/lockfile to add oxlint (and its platform bindings) and remove ESLint-related devDependencies.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.json Switches lint scripts and lint-staged to oxlint; removes ESLint-related devDependencies; adds packageManager pin.
eslint.config.mjs Deletes the ESLint flat config previously defining TypeScript/import/vitest lint behavior.
.oxlintrc.json Adds the new oxlint configuration, including ignore patterns, plugins, and rule overrides.
yarn.lock Adds oxlint and platform-specific optional bindings to the lockfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .oxlintrc.json
Comment thread .oxlintrc.json
Comment thread .oxlintrc.json Outdated
- Move no-empty and no-var off to a TS-only override to match old ESLint
  behavior (was incorrectly global)
- Enable vitest/no-import-node-test for test files
- Document unmappable rules: import/no-extraneous-dependencies,
  valid-expect-in-promise, and vitest recommended rules that require the
  jest plugin (blocked by max-nested-describe conflict)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@escapedcat escapedcat requested a review from Copilot April 1, 2026 07:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .oxlintrc.json
Comment thread package.json Outdated
escapedcat and others added 3 commits April 1, 2026 16:10
Replace Prettier with oxfmt (oxc formatter) and reformat the codebase.
Oxfmt targets Prettier-default parity; differences are minor line-wrapping
choices. This completes the migration from ESLint/Prettier to the oxc
toolchain (oxlint + oxfmt).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rconfig

- Rename .prettierignore to .oxfmtignore and pass --ignore-path explicitly
- Document that oxlint/oxfmt require Node >= 20 for local development
- Add indent_size = 2 to .editorconfig for space-indented file types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run oxlint and oxfmt in a single task group for *.{ts,js} files, and
only oxfmt for *.{json,yml,md}. Prevents duplicate processing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants