Use Oxlint instead of ESLint for JavaScript/TypeScript linting and add tests (#2226)#3309
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Install oxlint 1.56.0 - Create .oxlintrc.json with TS rules, Svelte 5 rune globals, and svelte ignore pattern - Fix unused variables discovered by oxlint (were not caught by ESLint previously) - Add 10 missing provider group tests in contest_table_provider_groups.test.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove @eslint/js dependency
- Remove js.configs.recommended from ESLint config
- Add '**/*.{js,ts,tsx,mjs,cjs}' to ESLint ignores so oxlint handles them
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add oxlint job for JS/TS files in pre-commit - Narrow eslint job to .svelte files only - Apply Prettier formatting to MathAndAlgorithm test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Mark all implementation steps as complete - Add post-implementation lessons: .oxlintrc.json naming, ESLint TS coverage gap, optional catch binding, unused imports → test addition - Update AGENTS.md tech stack and commands for hybrid lint setup - Update CONTRIBUTING.md to reflect oxlint + ESLint split Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughoxlint を導入して JS/TS 向けリントを分離(ESLint は Svelte のみ継続)。複数テストで型注釈や未使用パラメータ表記を整備し、テスト追加とコーディング規約(未使用インポート扱い・空の catch 禁止・any の代替案)を追加・更新した。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.oxlintrc.json:
- Around line 1-29: Replace the ESLint-scoped TypeScript rule keys with oxlint's
`typescript/` prefix in the rules object: change
`@typescript-eslint/ban-ts-comment` to `typescript/ban-ts-comment`,
`@typescript-eslint/no-unused-vars` to `typescript/no-unused-vars`, and
`@typescript-eslint/no-explicit-any` to `typescript/no-explicit-any` in the
.oxlintrc.json rules section, keeping the existing rule options intact.
In `@docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md`:
- Line 183: The plan references the wrong oxlint config filename `oxlint.json`;
update all occurrences in the plan section to the correct `.oxlintrc.json` so
names are consistent with the implementation note (replace `oxlint.json` →
`.oxlintrc.json` in the three places flagged including the table entry and the
two other mentions), ensuring the documentation uses the unique identifier
`.oxlintrc.json` everywhere.
- Line 84: The PR date for the oxc-project/oxc link in the document is
incorrect; update the text that currently reads "2026-03-27 オープン" to "2026-02-27
オープン" in the entry containing "PR
[oxc-project/oxc#19807](https://github.com/oxc-project/oxc/pull/19807):
\"Support .svelte file\"" so the line shows the correct creation date while
leaving the draft and Svelte support notes unchanged.
In `@e2e/signin.spec.ts`:
- Line 28: The logout helper currently declares an unused parameter `_username`
in the function signature `async function logout(page: Page, _username: string):
Promise<void>`, so remove that parameter from the signature and all call sites
(e.g., change any `logout(page, ...)` calls to `logout(page)`), updating the
TypeScript types accordingly (keep `page: Page` and return type unchanged) to
eliminate the unused argument and simplify the function contract.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a49faba6-225e-4a48-a50d-1a21183ceca6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (19)
.claude/rules/testing.md.oxlintrc.jsonAGENTS.mdCONTRIBUTING.mddocs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.mde2e/custom_colors.spec.tse2e/signin.spec.tseslint.config.mjslefthook.ymlpackage.jsonsrc/features/tasks/utils/contest-table/awc_provider.test.tssrc/features/tasks/utils/contest-table/contest_table_provider_groups.test.tssrc/features/tasks/utils/contest-table/joi_providers.test.tssrc/lib/index.tssrc/lib/types/apidata.tssrc/test/lib/services/fixtures/task_results.tssrc/test/lib/services/task_results.test.tssrc/test/lib/utils/auth_forms.test.tssrc/test/lib/utils/authorship.test.ts
💤 Files with no reviewable changes (1)
- src/lib/index.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 6
♻️ Duplicate comments (1)
.oxlintrc.json (1)
16-28:⚠️ Potential issue | 🔴 Criticaloxlint ルール名の修正が必須(過去レビューの再確認)
TypeScript ルールの命名規則が誤っています。oxlint では
@typescript-eslint/ではなくtypescript/プレフィックスを使用する必要があります:
@typescript-eslint/ban-ts-comment→typescript/ban-ts-comment@typescript-eslint/no-unused-vars→typescript/no-unused-vars@typescript-eslint/no-explicit-any→typescript/no-explicit-any以下のスクリプトで oxlint の有効なルール名を確認できます:
#!/bin/bash # Description: Verify available oxlint TypeScript rules pnpm exec oxlint --rules | grep -i "typescript"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.oxlintrc.json around lines 16 - 28, Update the rule keys to use the oxlint TypeScript prefix by replacing "@typescript-eslint/ban-ts-comment" with "typescript/ban-ts-comment", "@typescript-eslint/no-unused-vars" with "typescript/no-unused-vars", and "@typescript-eslint/no-explicit-any" with "typescript/no-explicit-any", keeping the existing rule configurations/values intact (e.g., the object for ban-ts-comment and the argsIgnorePattern/varsIgnorePattern for no-unused-vars) so only the keys are changed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.oxlintrc.json:
- Around line 7-14: The globals block in .oxlintrc.json declares Svelte runes
($state, $derived, $effect, $props, $bindable, $inspect) but .svelte files are
excluded by ignorePatterns; search the repo for usages of these runes (e.g.,
occurrences of "$state", "$derived", etc.) in JS/TS type definitions, utilities,
or components and if none are referenced remove the globals to tighten linting,
otherwise keep them; if runes are only used in .svelte files consider removing
the globals and/or updating ignorePatterns to include those files so the config
matches actual usage.
- Around line 19-20: The .oxlintrc.json currently sets "ts-ignore": true which
contradicts plan.md's requirement ("ts-ignore": false) and best practices;
update the configuration to disallow ts-ignore by setting "ts-ignore" to false
(and keep "ts-expect-error": "allow-with-description") unless there is a
documented, justified exception—if an exception is required, add a comment or a
documented policy referencing the specific rationale and the exact locations
where ts-ignore is allowed so reviewers can verify the intentional deviation.
In `@docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md`:
- Around line 226-230: The plan and implementation disagree on the
"@typescript-eslint/ban-ts-comment" setting for "ts-ignore": reconcile which
behavior you want (disallow ts-ignore or allow it) and make both the plan and
the actual .oxlintrc.json consistent: if you intend to disallow ts-ignore,
change the .oxlintrc.json "ts-ignore" value to false; if you intend to allow it
with description, change the plan’s entry (in plan.md) to "ts-ignore": true (or
to "allow-with-description" if that is the desired policy), and ensure the
documented policy and the config for "@typescript-eslint/ban-ts-comment"
reference the same setting.
- Line 128: セクションヘッダーのタイトルが誤って "### oxlint.json" になっているので、ドキュメント内の該当ヘッダー("###
oxlint.json" というテキスト)を "### .oxlintrc.json" に修正し、実装セクションで既に使われている
".oxlintrc.json" 表記と統一してください。
- Line 253: Update the commit message example in Step 4 to reference the correct
config filename: replace any mention of "oxlint.json" with ".oxlintrc.json"
(e.g., change the example command "git add oxlint.json package.json
pnpm-lock.yaml" to use ".oxlintrc.json" so the commit message and staged files
match the actual config name).
- Around line 454-456: Update the incorrect statement that "`.oxlintrc.json`
は自動検出されない" so the doc correctly states that `.oxlintrc.json` is auto-detected by
oxlint from the project root or current directory; also clarify that
`oxlint.json` (without the "rc") is likely the filename that is not
auto-detected, and adjust the surrounding bullets for accuracy (reference the
existing text fragment ".oxlintrc.json は自動検出されない" and the filename "oxlint.json"
when making the correction).
---
Duplicate comments:
In @.oxlintrc.json:
- Around line 16-28: Update the rule keys to use the oxlint TypeScript prefix by
replacing "@typescript-eslint/ban-ts-comment" with "typescript/ban-ts-comment",
"@typescript-eslint/no-unused-vars" with "typescript/no-unused-vars", and
"@typescript-eslint/no-explicit-any" with "typescript/no-explicit-any", keeping
the existing rule configurations/values intact (e.g., the object for
ban-ts-comment and the argsIgnorePattern/varsIgnorePattern for no-unused-vars)
so only the keys are changed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d00429f3-ce9d-43ce-8564-88b596686202
📒 Files selected for processing (2)
.oxlintrc.jsondocs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/rules/coding-style.md:
- Around line 58-59: 該当の「catch (error) { throw error; }」の例は実質不要なので、該当スニペット(catch
(error) { throw error; })をそのまま「Good」例にしないでください。修正案としては、①不要なら try/catch
自体を削除して例を単純化する、または②例としては catch ブロック内で文脈を追加する実装(例:ロギングを行う processLogger.error
やエラー情報を付加して再throw するパターン、あるいは new Error(..., { cause: error })
を使って原因を保持するパターン)に置き換えてください。どちらか一方のパターンを選び、該当スニペットをそれに差し替えてください。
- Line 35: 行35の「`as unknown as T` (double
cast)」を標準的な代替表現として扱う記述を、型安全性を損なわないように修正してください。具体的には、ガイド内で `Partial<T>` /
`Pick<T, ...>` / `satisfies` を第一候補として明示し、`as unknown as T`
は「最終手段(最後の手段)」として扱う文言に差し替え、例示や推奨順序を入れ替えて二重キャストの使用を抑止する説明に更新してください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ef321b95-2d32-487e-b6ce-5488243b9398
📒 Files selected for processing (1)
.claude/rules/coding-style.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary by CodeRabbit
リリースノート
Documentation
Tests
Chores