Skip to content

chore: migrate JS linting to Oxlint (AI-assisted)#10

Open
slorber wants to merge 1 commit into
mainfrom
codex/migrate-from-eslint-to-oxlint
Open

chore: migrate JS linting to Oxlint (AI-assisted)#10
slorber wants to merge 1 commit into
mainfrom
codex/migrate-from-eslint-to-oxlint

Conversation

@slorber

@slorber slorber commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Replace the root JavaScript linter with Oxlint to adopt a modern, low-maintenance default that focuses on correctness and common antipatterns rather than formatting.
  • Move away from needing to maintain long Airbnb preset rule lists while preserving conservative protections against regressions.
  • Preserve project-critical checks such as the copyright header rule and Docusaurus-specific rules, and keep React Compiler diagnostics via the React Hooks plugin.
  • This change was prepared with AI assistance (AI-assisted).

Description

  • Switches the root lint:js script to use oxlint and adds oxlint to devDependencies in package.json.
  • Removes the legacy ESLint flat config files (eslint.config.ts, eslint.rules.ts) and introduces a new oxlint.config.ts at repository root.
  • The oxlint.config.ts enables Oxlint categories (correctness, suspicious, perf), native Oxlint plugins and JS plugin adapters for eslint-plugin-header, @docusaurus/eslint-plugin, eslint-plugin-react-hooks, eslint-plugin-regexp, and others to retain custom rules.
  • Carries over important rules and overrides (copyright header, restricted lodash/fs usages, import ordering, React/TypeScript/Vitest/a11y rules, Docusaurus plugin rules, and path-specific overrides) while adding conservative defaults and JS-plugin fallbacks for rules not yet native to Oxlint.

Testing

  • Ran node -e "JSON.parse(require('fs').readFileSync('package.json','utf8')); console.log('package.json OK')" which succeeded.
  • Verified oxlint.config.ts contains expected markers with node -e checks for defineConfig, header/header, and React Compiler rules which succeeded.
  • Ran git diff --check -- . ':!eslint.config.ts' ':!eslint.rules.ts' to ensure no trailing whitespace or diff-check errors, which passed.
  • Attempts to run yarn lint:js --version and yarn format:diff oxlint.config.ts could not execute in this environment because dev dependencies are not installed (oxlint/oxfmt not found).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant