chore: replace eslint with oxlint#4756
Conversation
Swap ESLint + 10 related plugins for oxlint, and Prettier for oxfmt. Lint rules from eslint.config.mjs are mapped in .oxlintrc.json; unmappable rules (import/no-extraneous-dependencies, valid-expect-in-promise) and the vitest/jest plugin conflict are documented inline. - Delete eslint.config.mjs, add .oxlintrc.json with TS-only no-empty/no-var - Rename .prettierignore -> .oxfmtignore - Update lint/format scripts in package.json - Split lint-staged into ts/js (lint+fmt) and json/yml/md (fmt only) - Add indent_size = 2 to .editorconfig for json/yml/md/svg Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mechanical reformat across 183 files. No behavior changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Summary by QodoReplace ESLint with Oxlint and Prettier with Oxfmt
WalkthroughsDescription• **Replaced ESLint with Oxlint**: Migrated from ESLint to Oxlint as the primary linter, removing all ESLint-related dependencies (@eslint/eslintrc, @typescript-eslint/*, eslint-* packages) and adding oxlint and oxfmt dependencies • **Replaced Prettier with Oxfmt**: Updated formatting tool from Prettier to Oxfmt in lint and format scripts • **Created Oxlint configuration**: Added .oxlintrc.json with plugins for TypeScript, imports, and vitest, migrated from ESLint v10 flat config • **Code formatting consolidation**: Reformatted 150+ files to comply with Oxlint and Oxfmt rules, consolidating multi-line statements into single lines for consistency • **Standardized package.json field ordering**: Reorganized all package.json files to follow standard field ordering conventions • **Updated configuration files**: Modified .editorconfig to add indent size configuration for formatted files • **Removed ESLint configuration**: Deleted eslint.config.mjs file as it is no longer needed • **Updated CommonJS modules**: Changed quote styles in .cjs files for consistency with new formatter rules Diagramflowchart LR
A["ESLint + Prettier"] -->|"Remove dependencies"| B["Remove ESLint config"]
B -->|"Add new linter"| C["Oxlint + Oxfmt"]
C -->|"Create config"| D[".oxlintrc.json"]
C -->|"Reformat code"| E["150+ files reformatted"]
E -->|"Standardize"| F["package.json & config files"]
File Changes1. @commitlint/cli/src/cli.test.ts
|
Code Review by Qodo
1. Invalid oxlint JSON config
|
oxlint's vitest plugin does not include a no-focused-tests rule, so a stray it.only / describe.only could silently disable the rest of a test file after the eslint -> oxlint migration. Adds a small script that scans test files for *.only(...) and wires it into both lint-staged (per-file on commit) and the CI codeQuality job (full sweep, can't be skipped with --no-verify). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Migrates the repo’s JavaScript/TypeScript linting/formatting workflow from ESLint to oxlint/oxfmt, and adds a replacement safeguard for focused Vitest tests that ESLint previously caught.
Changes:
- Remove ESLint flat config and introduce
.oxlintrc.json(oxlint) +.oxfmtignore(oxfmt), wiring them intoyarn lint/yarn format. - Add a custom
scripts/check-no-focused-tests.jscheck and run it in CI and vialint-staged. - Apply repo-wide formatting/structure updates across TS/JS sources, tests, docs, and package manifests.
Reviewed changes
Copilot reviewed 188 out of 191 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/check-no-focused-tests.js | New focused-test guard script used by CI and lint-staged. |
| eslint.config.mjs | Removed ESLint flat config (migration to oxlint). |
| docs/reference/rules.md | Formatting update in documentation examples. |
| docs/reference/examples.md | Formatting update in documentation examples. |
| docs/reference/configuration.md | Formatting update in documentation examples. |
| docs/api/load.md | Formatting update in documentation examples. |
| docs/api/lint.md | Formatting update in documentation examples. |
| docs/.vitepress/config.ts | Formatting update to VitePress config. |
| @packages/utils/pkg-check.js | Formatting change (note: touches control-flow line). |
| @packages/utils/package.json | Package manifest reordering/normalization. |
| @packages/utils/dep-check.js | Formatting update. |
| @packages/test/src/npm.ts | Formatting update. |
| @packages/test/package.json | Package manifest reordering/normalization. |
| @packages/test-environment/package.json | Package manifest reordering/normalization. |
| @commitlint/types/src/rules.ts | Type formatting and minor type-shape adjustments. |
| @commitlint/types/src/rules.test-d.ts | Formatting update to type tests. |
| @commitlint/types/src/prompt.ts | Formatting update. |
| @commitlint/types/src/parse.ts | Formatting update. |
| @commitlint/types/src/load.ts | Formatting update. |
| @commitlint/types/src/lint.ts | Formatting update. |
| @commitlint/types/src/format.ts | Formatting update. |
| @commitlint/types/package.json | Package manifest reordering/normalization. |
| @commitlint/travis-cli/src/cli.ts | Formatting update. |
| @commitlint/travis-cli/src/cli.test.ts | Formatting update. |
| @commitlint/travis-cli/package.json | Package manifest reordering/normalization. |
| @commitlint/top-level/package.json | Package manifest reordering/normalization. |
| @commitlint/to-lines/src/index.test.ts | Formatting update. |
| @commitlint/to-lines/package.json | Package manifest reordering/normalization. |
| @commitlint/rules/src/type-min-length.ts | Formatting update. |
| @commitlint/rules/src/type-max-length.ts | Formatting update. |
| @commitlint/rules/src/type-enum.ts | Formatting update. |
| @commitlint/rules/src/type-case.test.ts | Formatting update. |
| @commitlint/rules/src/trailer-exists.ts | Formatting update. |
| @commitlint/rules/src/trailer-exists.test.ts | Formatting update. |
| @commitlint/rules/src/subject-min-length.ts | Formatting update. |
| @commitlint/rules/src/subject-max-length.ts | Formatting update. |
| @commitlint/rules/src/subject-full-stop.ts | Formatting update. |
| @commitlint/rules/src/subject-full-stop.test.ts | Formatting update. |
| @commitlint/rules/src/signed-off-by.ts | Formatting update. |
| @commitlint/rules/src/signed-off-by.test.ts | Formatting update. |
| @commitlint/rules/src/scope-min-length.ts | Formatting update. |
| @commitlint/rules/src/scope-max-length.ts | Formatting update. |
| @commitlint/rules/src/scope-enum.ts | Formatting update. |
| @commitlint/rules/src/scope-delimiter-style.ts | Formatting update. |
| @commitlint/rules/src/scope-case.ts | Formatting update. |
| @commitlint/rules/src/scope-case.test.ts | Formatting update. |
| @commitlint/rules/src/references-empty.test.ts | Formatting update. |
| @commitlint/rules/src/index.test.ts | Formatting update. |
| @commitlint/rules/src/header-trim.ts | Formatting update. |
| @commitlint/rules/src/header-trim.test.ts | Formatting update. |
| @commitlint/rules/src/header-min-length.ts | Formatting update. |
| @commitlint/rules/src/header-max-length.ts | Formatting update. |
| @commitlint/rules/src/header-full-stop.ts | Formatting update. |
| @commitlint/rules/src/header-case.test.ts | Formatting update. |
| @commitlint/rules/src/footer-min-length.ts | Formatting update. |
| @commitlint/rules/src/footer-max-line-length.ts | Formatting update. |
| @commitlint/rules/src/footer-max-length.ts | Formatting update. |
| @commitlint/rules/src/footer-leading-blank.ts | Formatting update. |
| @commitlint/rules/src/footer-leading-blank.test.ts | Formatting update. |
| @commitlint/rules/src/breaking-change-exclamation-mark.ts | Formatting update. |
| @commitlint/rules/src/breaking-change-exclamation-mark.test.ts | Formatting update. |
| @commitlint/rules/src/body-min-length.ts | Formatting update. |
| @commitlint/rules/src/body-max-line-length.ts | Formatting update. |
| @commitlint/rules/src/body-max-line-length.test.ts | Formatting update. |
| @commitlint/rules/src/body-max-length.ts | Formatting update. |
| @commitlint/rules/src/body-full-stop.ts | Formatting update. |
| @commitlint/rules/package.json | Package manifest reordering/normalization. |
| @commitlint/resolve-extends/src/index.ts | Formatting update. |
| @commitlint/resolve-extends/src/index.test.ts | Formatting update. |
| @commitlint/resolve-extends/package.json | Package manifest reordering/normalization. |
| @commitlint/read/src/read.ts | Formatting update. |
| @commitlint/read/src/read.test.ts | Formatting update. |
| @commitlint/read/src/get-edit-file-path.ts | Formatting update. |
| @commitlint/read/src/get-edit-commit.ts | Formatting update. |
| @commitlint/read/package.json | Package manifest reordering/normalization. |
| @commitlint/prompt/src/settings.ts | Formatting update. |
| @commitlint/prompt/src/library/utils.ts | Formatting update. |
| @commitlint/prompt/src/library/utils.test.ts | Formatting update. |
| @commitlint/prompt/src/library/types.ts | Formatting update. |
| @commitlint/prompt/src/library/get-prompt.ts | Formatting update. |
| @commitlint/prompt/src/library/get-forced-leading-fn.ts | Formatting update. |
| @commitlint/prompt/src/library/get-forced-case-fn.ts | Formatting update. |
| @commitlint/prompt/src/library/get-forced-case-fn.test.ts | Formatting update. |
| @commitlint/prompt/src/library/format.ts | Formatting update. |
| @commitlint/prompt/src/inquirer/inquirer.d.ts | Formatting update. |
| @commitlint/prompt/src/inquirer/InputCustomPrompt.ts | Formatting update. |
| @commitlint/prompt/src/input.ts | Formatting update. |
| @commitlint/prompt/src/input.test.ts | Formatting update. |
| @commitlint/prompt/package.json | Package manifest reordering/normalization. |
| @commitlint/prompt-cli/package.json | Package manifest reordering/normalization. |
| @commitlint/prompt-cli/cli.js | Formatting update. |
| @commitlint/parse/src/index.ts | Formatting update. |
| @commitlint/parse/src/index.test.ts | Formatting update. |
| @commitlint/parse/package.json | Package manifest reordering/normalization. |
| @commitlint/message/src/index.test.ts | Formatting update. |
| @commitlint/message/package.json | Package manifest reordering/normalization. |
| @commitlint/load/src/utils/plugin-naming.ts | Formatting update. |
| @commitlint/load/src/utils/load-plugin.ts | Formatting update. |
| @commitlint/load/src/utils/load-plugin.test.ts | Formatting update. |
| @commitlint/load/src/utils/load-parser-opts.ts | Formatting update. |
| @commitlint/load/src/utils/load-config.ts | Formatting update. |
| @commitlint/load/src/load.ts | Formatting update. |
| @commitlint/load/package.json | Package manifest reordering/normalization. |
| @commitlint/lint/src/lint.ts | Formatting update. |
| @commitlint/lint/src/lint.test.ts | Formatting update. |
| @commitlint/lint/src/commit-message.ts | Formatting update. |
| @commitlint/lint/package.json | Package manifest reordering/normalization. |
| @commitlint/is-ignored/src/is-ignored.ts | Formatting update. |
| @commitlint/is-ignored/src/is-ignored.test.ts | Formatting update. |
| @commitlint/is-ignored/src/defaults.ts | Formatting update. |
| @commitlint/is-ignored/package.json | Package manifest reordering/normalization. |
| @commitlint/format/src/format.ts | Formatting update. |
| @commitlint/format/src/format.test.ts | Formatting update. |
| @commitlint/format/package.json | Package manifest reordering/normalization. |
| @commitlint/execute-rule/src/index.ts | Formatting update. |
| @commitlint/execute-rule/package.json | Package manifest reordering/normalization. |
| @commitlint/ensure/src/to-case.ts | Formatting update. |
| @commitlint/ensure/src/not-empty.ts | Formatting update. |
| @commitlint/ensure/src/max-line-length.ts | Formatting update. |
| @commitlint/ensure/src/case.ts | Formatting update. |
| @commitlint/ensure/package.json | Package manifest reordering/normalization. |
| @commitlint/cz-commitlint/src/utils/rules.ts | Formatting update. |
| @commitlint/cz-commitlint/src/utils/rules.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/utils/leading-blank-fn.ts | Formatting update. |
| @commitlint/cz-commitlint/src/utils/case-fn.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/store/rules.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/store/prompts.ts | Formatting update. |
| @commitlint/cz-commitlint/src/store/prompts.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/store/defaultPromptConfigs.ts | Formatting update. |
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts | Formatting update. |
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/SectionHeader.ts | Formatting update. |
| @commitlint/cz-commitlint/src/SectionHeader.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/SectionFooter.ts | Formatting update. |
| @commitlint/cz-commitlint/src/SectionFooter.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/Question.ts | Formatting update. |
| @commitlint/cz-commitlint/src/Question.test.ts | Formatting update. |
| @commitlint/cz-commitlint/src/Process.ts | Formatting update. |
| @commitlint/cz-commitlint/src/Process.test.ts | Formatting update. |
| @commitlint/cz-commitlint/package.json | Package manifest reordering/normalization. |
| @commitlint/cz-commitlint/index.cjs | Formatting/style update in CJS entrypoint. |
| @commitlint/core/package.json | Package manifest reordering/normalization. |
| @commitlint/config-workspace-scopes/package.json | Package manifest reordering/normalization. |
| @commitlint/config-workspace-scopes/index.test.js | Formatting update. |
| @commitlint/config-workspace-scopes/index.js | Formatting update. |
| @commitlint/config-validator/src/validate.ts | Formatting update. |
| @commitlint/config-validator/src/validate.test.ts | Formatting update. |
| @commitlint/config-validator/src/formatErrors.ts | Formatting update. |
| @commitlint/config-validator/package.json | Package manifest reordering/normalization. |
| @commitlint/config-rush-scopes/package.json | Package manifest reordering/normalization. |
| @commitlint/config-rush-scopes/index.js | Formatting update. |
| @commitlint/config-pnpm-scopes/package.json | Package manifest reordering/normalization (+ exports block placement). |
| @commitlint/config-pnpm-scopes/index.ts | Formatting update. |
| @commitlint/config-patternplate/package.json | Package manifest reordering/normalization. |
| @commitlint/config-patternplate/index.js | Formatting update. |
| @commitlint/config-nx-scopes/readme.md | Formatting update. |
| @commitlint/config-nx-scopes/package.json | Package manifest reordering/normalization. |
| @commitlint/config-nx-scopes/index.js | Formatting update. |
| @commitlint/config-lerna-scopes/package.json | Package manifest reordering/normalization. |
| @commitlint/config-lerna-scopes/index.test.js | Formatting update. |
| @commitlint/config-lerna-scopes/index.js | Formatting update. |
| @commitlint/config-conventional/src/index.ts | Formatting update. |
| @commitlint/config-conventional/src/index.test.ts | Formatting update. |
| @commitlint/config-conventional/package.json | Package manifest reordering/normalization. |
| @commitlint/config-angular/package.json | Package manifest reordering/normalization. |
| @commitlint/config-angular/index.test.js | Formatting update. |
| @commitlint/config-angular/index.js | Formatting update. |
| @commitlint/config-angular-type-enum/package.json | Package manifest reordering/normalization. |
| @commitlint/config-angular-type-enum/index.js | Formatting update. |
| @commitlint/cli/src/cli-error.ts | Formatting update. |
| @commitlint/cli/package.json | Package manifest reordering/normalization. |
| @commitlint/cli/index.cjs | Formatting/style update in CJS entrypoint. |
| @alias/commitlint/package.json | Package manifest reordering/normalization. |
| @alias/commitlint-config-patternplate/package.json | Package manifest reordering/normalization. |
| @alias/commitlint-config-nx-scopes/package.json | Package manifest reordering/normalization. |
| @alias/commitlint-config-lerna-scopes/package.json | Package manifest reordering/normalization. |
| @alias/commitlint-config-angular/package.json | Package manifest reordering/normalization. |
| .oxlintrc.json | New oxlint configuration (replacing ESLint ruleset). |
| .oxfmtignore | New oxfmt ignore list for formatter runs. |
| .github/workflows/CI.yml | Adds CI step to fail on focused tests after linting. |
| .editorconfig | Specifies 2-space indentation for JSON/YAML/MD/etc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- pkg-check.js: split broken console.warn(...).process.exit(0) chain into two statements. The bug pre-dates this PR (oxfmt only collapsed the multi-line form to one line) and the branch is dead code on modern Node, but the call would have thrown if ever reached. - .oxlintrc.json: update stale ">=v18" engines comment to ">=22.12.0", matching the current package.json after v21.0.0. - check-no-focused-tests.js: scan whole-file rather than line-by-line so multi-line forms (`it\n .only(...)`) are caught, and stop the regex at a token boundary so chained variants like `it.only.each(...)` match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Promote vitest/require-to-throw-message from default (warn) to error and fix the three call sites that were warning. Bare .toThrow() can pass on the wrong error type/message; asserting the expected message makes the tests fail loudly when the thrown error changes. - Question.test.ts: assert "Question: name is required" - load.test.ts: assert /Cannot find module/ from resolve-extends Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces: #4678