Skip to content

fix: Address lint errors after svelte-check and eslint pass#3301

Merged
KATO-Hiro merged 2 commits into
stagingfrom
#2345
Mar 23, 2026
Merged

fix: Address lint errors after svelte-check and eslint pass#3301
KATO-Hiro merged 2 commits into
stagingfrom
#2345

Conversation

@KATO-Hiro
Copy link
Copy Markdown
Collaborator

@KATO-Hiro KATO-Hiro commented Mar 23, 2026

close #2345

  • TaskTable: restore SvelteMap for contestTableMaps and taskIndicesMap (svelte/prefer-svelte-reactivity requires SvelteMap in $state/$derived contexts)
  • KanbanBoard: re-apply resolve() with path/search split to satisfy no-navigation-without-resolve
  • AuthForm: add eslint-disable comment for alternativeHref (union type prevents resolve())

Summary by CodeRabbit

リリースノート

  • Refactor
    • 内部のリアクティブマップ実装を最適化
    • URLハンドリングロジックを改善
    • コード品質と型安全性を強化

- TaskTable: restore SvelteMap for contestTableMaps and taskIndicesMap
  (svelte/prefer-svelte-reactivity requires SvelteMap in $state/$derived contexts)
- KanbanBoard: re-apply resolve() with path/search split to satisfy no-navigation-without-resolve
- AuthForm: add eslint-disable comment for alternativeHref (union type prevents resolve())

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 2026

Warning

Rate limit exceeded

@KATO-Hiro has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38d025a7-1ddd-4df7-a4e7-9d1d58cb43b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7c2690d and cce098d.

📒 Files selected for processing (1)
  • src/routes/(admin)/workbooks/order/_components/KanbanBoard.svelte
📝 Walkthrough

Walkthrough

Svelte コンポーネント3つで型の変更とリント対応を実施。TaskTable.svelte では Map をリアクティブな SvelteMap に切り替え、AuthForm.svelte と KanbanBoard.svelte で ESLint・TypeScript の警告コメントを追加。

Changes

コホート / ファイル 変更内容
リアクティブマップ化
src/features/tasks/components/contest-table/TaskTable.svelte
prepareContestTablesMaptaskIndicesMap で標準 Map から SvelteMap へ変更。導出状態のリアクティビティ向上。
リント無視コメント
src/lib/components/AuthForm.svelte
eslint-disable-next-line svelte/no-navigation-without-resolve コメント追加。ナビゲーションリンク警告の抑制。
URL処理の最適化
src/routes/(admin)/workbooks/order/_components/KanbanBoard.svelte
$app/pathsresolve 関数を使用し、replaceState の引数を resolve(pathname) + search 形式に変更。TypeScript 型チェック無視コメント追加。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Svelte の地図は今や生きて呼吸し 🗺️
リアクティブな魂を備えて
リントの呼び声も優しく静まり
URL は正しき道を歩む
小さな変更、大きな調和 ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title accurately describes the main objective: addressing lint errors from svelte-check and eslint validation across multiple components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #2345

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/features/tasks/components/contest-table/TaskTable.svelte (2)

68-80: 🧹 Nitpick | 🔵 Trivial

戻り値の型注釈を SvelteMap に更新することを推奨

関数内で SvelteMap を生成・返却していますが、戻り値の型は Map<string, ProviderData> のままです。SvelteMapMap を継承しているため動作上の問題はありませんが、型の一貫性のため更新を検討してください。

♻️ 型注釈の修正案
- function prepareContestTablesMap(providers: ContestTableProvider[]): Map<string, ProviderData> {
+ function prepareContestTablesMap(providers: ContestTableProvider[]): SvelteMap<string, ProviderData> {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/tasks/components/contest-table/TaskTable.svelte` around lines 68
- 80, The function prepareContestTablesMap currently returns a Map<string,
ProviderData> but constructs and returns a SvelteMap<string, ProviderData>;
update the function signature to return SvelteMap<string, ProviderData> to keep
types consistent. Locate prepareContestTablesMap (uses ContestTableProvider,
ProviderData and calls prepareContestTable) and change its declared return type
accordingly; ensure any callers expecting Map handle SvelteMap or update their
types if necessary.

149-162: 🧹 Nitpick | 🔵 Trivial

taskResultsMap の型注釈も同様に要確認

reduce のアキュムレータの型が Map<ContestTaskPairKey, TaskResult> ですが、初期値として SvelteMap を渡しています。一貫性のため修正を推奨します。

♻️ 型注釈の修正案
  let taskResultsMap = $derived.by(() => {
    return taskResults.reduce(
-     (map: Map<ContestTaskPairKey, TaskResult>, taskResult: TaskResult) => {
+     (map: SvelteMap<ContestTaskPairKey, TaskResult>, taskResult: TaskResult) => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/tasks/components/contest-table/TaskTable.svelte` around lines
149 - 162, The reduce accumulator is typed as Map<ContestTaskPairKey,
TaskResult> but the initial value is a SvelteMap; update the types so they match
by changing the reducer's accumulator type to SvelteMap<ContestTaskPairKey,
TaskResult> (or alternatively replace the initial value with a plain Map) so
taskResultsMap, the taskResults.reduce call, and the SvelteMap usage are
consistent with TaskResult and createContestTaskPairKey.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/components/AuthForm.svelte`:
- Around line 227-228: Remove the inline ESLint disable and update the anchor to
call resolve() directly in the href instead of using the precomputed
alternativeHref; specifically, in AuthForm.svelte replace the anchor using the
ESLint suppression and href={alternativeHref} with an anchor using
href={resolve(alternativePageLink)} (or the appropriate page link variable used
to compute alternativeHref) so the svelte/no-navigation-without-resolve rule is
satisfied and the suppression can be deleted.

In `@src/routes/`(admin)/workbooks/order/_components/KanbanBoard.svelte:
- Around line 63-64: 現在の `@ts-expect-error` は型安全性を隠しており RouteId/params と PageState
の整合性を壊しているため、resolve/replaceState 呼び出しを型安全に揃えて updatedUrl.hash と state
を保持するよう修正してください: updatedUrl を使って直接 replaceState(resolve(...) +
updatedUrl.search, {}) とするのではなく、$page.route.id と $page.params を利用して resolve
の引数を型に合う形で組み立て、第二引数に $page.state(PageState 型)を渡して state を保持し、最後に updatedUrl.hash
も復元するよう replaceState 呼び出しを置き換えてください(参照箇所: resolve, replaceState, updatedUrl,
updatedUrl.hash, $page.route.id, $page.params, $page.state, PageState)。

---

Outside diff comments:
In `@src/features/tasks/components/contest-table/TaskTable.svelte`:
- Around line 68-80: The function prepareContestTablesMap currently returns a
Map<string, ProviderData> but constructs and returns a SvelteMap<string,
ProviderData>; update the function signature to return SvelteMap<string,
ProviderData> to keep types consistent. Locate prepareContestTablesMap (uses
ContestTableProvider, ProviderData and calls prepareContestTable) and change its
declared return type accordingly; ensure any callers expecting Map handle
SvelteMap or update their types if necessary.
- Around line 149-162: The reduce accumulator is typed as
Map<ContestTaskPairKey, TaskResult> but the initial value is a SvelteMap; update
the types so they match by changing the reducer's accumulator type to
SvelteMap<ContestTaskPairKey, TaskResult> (or alternatively replace the initial
value with a plain Map) so taskResultsMap, the taskResults.reduce call, and the
SvelteMap usage are consistent with TaskResult and createContestTaskPairKey.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5f0cc831-e91c-4de2-b192-78ae663c13a6

📥 Commits

Reviewing files that changed from the base of the PR and between b76fd16 and 7c2690d.

📒 Files selected for processing (3)
  • src/features/tasks/components/contest-table/TaskTable.svelte
  • src/lib/components/AuthForm.svelte
  • src/routes/(admin)/workbooks/order/_components/KanbanBoard.svelte

Comment thread src/lib/components/AuthForm.svelte
Comment thread src/routes/(admin)/workbooks/order/_components/KanbanBoard.svelte Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit 78585d3 into staging Mar 23, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2345 branch March 23, 2026 06:04
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.

[Library] eslint-plugin-svelte のアップデートに伴うLintエラーを修正しましょう

1 participant