Skip to content

[調査] ESLint 10 移行: upstream 未対応時の代替策選定(Issue #114 フェーズ2 前提調査) #266

Closed

Description

@info-mnml

経緯

Issue #114 フェーズ2(ESLint 10 bump)の前提として、upstream 3 プラグインの ESLint 10 対応をウォッチ中。
週次プローブ(2026-09-07 実行分)で probe=failure が続いており、代替策検討開始期限(2026-09-15)・最終締切(2026-09-30)が迫っている。

upstream(jsx-eslint/eslint-plugin-react#3979)が 9/14 プローブ時点でも未リリースの場合に備え、代替策の実現可能性を事前調査する。

「作らない」選択肢の検討

  • 既存機能で代替可: 不可。ESLint 9 は EOL 済みでセキュリティパッチなし。維持継続は技術負債の拡大。
  • 削除で代替可: 不可。lint 廃止は品質低下でアウト。
  • upstream を待つだけ: 9/30 期限に間に合わない可能性があるため、今から選択肢を整理しておく必要がある。

要件

  1. 以下の代替策について the-botch の現構成(Next.js + flat config)での実現可能性を評価する
  2. 推奨案を 1 つ選定し、フェーズ2 実装 Issue を即起票できる状態にする

評価対象の代替策

案 内容 ポイント
A: @eslint/compat 互換レイヤ ESLint 公式の fixupPluginRules() / fixupConfigRules() で既存プラグインをラップ 既存ルール設定をほぼ維持。移行コスト最小
B: @eslint-react/eslint-plugin 切替 eslint-plugin-react の ESLint 10 ネイティブ後継プラグイン ルール名が変わる(破壊的変更あり)。長期的に clean
C: ESLint 9 延命(9/30 以降も継続) セキュリティ監視を強化しつつ upstream 待ちを継続 セキュリティリスク受容。追加コストなし

調査内容(researcher に委託)

  1. @eslint/compat を使って the-botch の eslint.config.mjs を最小変更で ESLint 10 対応させる PoC を実施
    • 対象プラグイン: eslint-plugin-react、eslint-plugin-jsx-a11y、eslint-plugin-import
    • 成功基準: eslint@^10 で既存のエラー件数が増えないこと
  2. @eslint-react/eslint-plugin の最新バージョン・ESLint 10 対応状況・the-botch で使用中のルールとの互換性を確認
  3. upstream eslint-plugin-react の npm weekly DL 数とコミュニティ動向確認
  4. 各案のリスク・工数(ファイル変更数・テスト影響)を比較表でまとめ

受け入れ条件

  • A / B / C 各案の実現可能性と工数を比較した調査レポートが Issue コメントに記録される
  • 推奨案(A/B/C)とその根拠が明記される
  • 推奨案が A or B の場合、実装 Issue のドラフト(タイトル・要件・受け入れ条件)が添付される

smoke test 結果

  • 実施日時: (調査タスクのためコード変更なし)
  • 実施内容: 該当なし
  • 結果: 該当なし

メタデータ

@claude

Activity

  1. info-mnml commented on Sep 8, 2026

    @info-mnml
    CollaboratorAuthor

    Claude finished @info-mnml's task in 4m 30s —— View job


    ESLint 10 移行代替策 調査レポート

    Todo

    • 現構成の確認 (eslint.config.mjs / package.json / package-lock.json)
    • baseline: 依存プラグインの peer 範囲を lockfile から抽出
    • 案A: @eslint/compat の適用可能性を評価
    • 案B: @eslint-react/eslint-plugin 切替の影響評価
    • 案C: ESLint 9 延命のリスク評価
    • upstream の全体像整理(隠れた選択肢 D の発見)
    • 3案比較表・推奨案の選定
    • 推奨案(C)のフォローアップアクション記載

    ⚠️ 実行制約: 本 Actions ランナーではネットワーク経由の npm install が使えないため、eslint@^10 を実際に入れた PoC は未実行。以下は the-botch/package-lock.json に固定されている実バージョンの peerDependenciesと eslint.config.mjs の構造から導いた解析。


    1. 現構成の再定義(Issue の前提を修正)

    Issue 本文は「upstream 3 プラグイン(eslint-plugin-react / eslint-plugin-jsx-a11y / eslint-plugin-import)」を直接依存として扱っているが、package.json を確認すると the-botch はこれら 3 プラグインを直接 depend していない。すべて eslint-config-next@^16.3.2 の推移的依存として入っている。

    the-botch/eslint.config.mjs:

    import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'
    import nextTypescript from 'eslint-config-next/typescript'
    // ...

    the-botch/package.json devDependencies:

    "eslint": "^9.39.5",
    "eslint-config-next": "^16.3.2",
    

    含意: 「the-botch を ESLint 10 対応させる」の実質的なオーナーは eslint-plugin-react 単体ではなく eslint-config-next(= Next.js チーム)。upstream watch 先も jsx-eslint/eslint-plugin-react#3979 単独ではなく vercel/next.js(packages/eslint-config-next)を含める必要がある。

    2. peer レンジ実態表(the-botch/package-lock.json より)

    プラグイン 固定 version ESLint peer 範囲 ESLint 10 可否
    eslint-config-next 16.3.2 >=9.0.0 ✅ 上限なし
    @next/eslint-plugin-next 16.3.2 (peer 指定なし) ✅
    eslint-plugin-react 7.37.5 ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 ❌ ブロッカー
    eslint-plugin-jsx-a11y (^6.10.0) ^3 || ... || ^9 ❌ ブロッカー
    eslint-plugin-import (^2.32.0) ^2 || ... || ^9 ❌ ブロッカー
    eslint-plugin-react-hooks 7.1.1 ^3 || ... || ^9 || ^10 ✅ 既に対応済み
    typescript-eslint (^8.46.0) ^8.57 || ^9 || ^10 ✅ 既に対応済み

    ブロッカーは3本(Issue の想定通り)だが、いずれも eslint-config-next 経由。単独 upgrade は困難。

    3. 案別実現可能性

    案 A: @eslint/compat(fixupPluginRules / fixupConfigRules)

    • 性質: eslintrc 時代のプラグイン context.* 削除に伴う API 差分を吸収するシム。ESLint 9→10 の破壊対象が API レベルなら有効、peer 宣言だけの問題なら実は不要(--legacy-peer-deps や package.json の overrides で足りる)。
    • the-botch への適用: eslint.config.mjs で nextCoreWebVitals / nextTypescript を import した後、対象プラグインを含む config エントリを fixupConfigRules(...) でラップし直す必要がある。eslint-config-next の内部構造(プラグイン参照の埋め方)に依存するため、Next.js 16.x のアップデートで壊れやすい。
    • 工数: 中(eslint.config.mjs 1 ファイルに 20〜40 行追加、動作確認 1〜2 時間)。
    • リスク: 実際の破壊内容が分かるまで有効かは不透明。eslint-config-next の内部変更で継続的な保守負担が発生。
    • 前提: 実行可能な npm install eslint@10 @eslint/compat PoC が必要(本 Actions では未実行)。

    案 B: @eslint-react/eslint-plugin 切替

    • 性質: React lint の完全な別実装。ルール名が react/* → @eslint-react/* に変わる破壊的変更あり。
    • the-botch への適用: eslint-config-next の React ルール群を丸ごと差し替える必要がある。しかしこれは eslint-plugin-jsx-a11y と eslint-plugin-import の ESLint 10 非対応を解決しない。片肺の解決策。
    • 工数: 高(React ルール一式の再構築 + jsx-a11y/import の別対応が別途必要 = 実質 2 段階の移行)。
    • リスク: eslint-config-next の Next.js 特化ルール(no-html-link-for-pages 等)は @next/eslint-plugin-next から供給されるので保持できるが、React 系のカバレッジ調整は手作業。
    • 判定: 今回のスコープでは不採用。ブロッカー 3 本のうち 1 本しか解決しない。

    案 C: ESLint 9 延命

    • 性質: 何もしない。upstream(Next.js / 3 プラグイン)が揃うまで待つ。
    • the-botch への適用: package.json / eslint.config.mjs に一切変更なし。
    • 工数: ゼロ。
    • リスク再評価:
      • ESLint は 開発時・CI 時のみ動く静的解析ツール。ランタイム / エッジに乗らないため、脆弱性が「本番アプリのユーザーに到達する」経路がない。過去 12 か月の ESLint コア CVE は ReDoS 系が中心で、the-botch の CI に対する実害はほぼゼロ。
      • npm audit は ESLint 9 自体を「脆弱」とは報告しない(EOL は npm audit の対象外)。
      • 依存 tree の下位パッケージ(micromatch / debug / chalk 等)のパッチは ESLint メジャーに無関係で継続入手可能。
      • eslint-config-next@16.x は既に ESLint 9 で安定稼働中で、Next.js 16 も同構成が公式サポート。
    • 判定: 現時点で最もコスト対効果が高い。

    案 D(発見): eslint-config-next の ESLint 10 対応を待つ

    • 性質: そもそも the-botch の ESLint スタックは Vercel が一貫バンドルしている。バンドル側が ESLint 10 を切り替えると、the-botch は eslint と eslint-config-next を bump するだけで済む。
    • watch 先: vercel/next.js の packages/eslint-config-next および @next/eslint-plugin-next リリースノート、eslint-config-next@17 / Next.js 17 (or 16.x point release) の予告。
    • 判定: 案 C と組み合わせて自然に到達する終着点。

    4. 案比較表

    観点 A: @eslint/compat B: @eslint-react 切替 C: ESLint 9 延命
    変更ファイル数 eslint.config.mjs + package.json (2〜3) eslint.config.mjs 大改修 + package.json (2) 0
    コード変更量 中(20〜40 行) 大(80〜200 行、ルール棚卸し要) 0
    lint エラー再発 低(fixup が動けば同ルールセット) 高(ルール名変更で fail → 逐次対応) なし
    jsx-a11y / import の 10 対応 ❌ 別途 upstream 待ち ❌ 別途 upstream 待ち ❌ 別途 upstream 待ち
    保守コスト 中(eslint-config-next 内部変更に追随) 中〜高(ルール棚卸し継続) ほぼゼロ
    ロールバック難度 低(config 差戻し) 高(ルールセット再構築) N/A
    セキュリティリスク Low Low Low(開発時ツール)
    期限 9/30 に間に合うか Yes(PoC 次第) No(工数超過) Yes

    5. 推奨案: C(ESLint 9 延命)+ upstream watch 継続

    根拠:

    1. ESLint 9 の実運用リスクは低い(dev/CI 限定・ランタイム非接触・npm audit 非該当)。
    2. 主戦場である eslint-plugin-jsx-a11y と eslint-plugin-import は upstream 動向に完全依存。案 A/B/C いずれもこれらを解決しない → 「解決の主導権が upstream にある」構造。
    3. the-botch が単独で先行 ESLint 10 化しても、eslint-config-next を維持する限り peer 警告か overrides ハックが残り続ける。Next.js チームの正式対応が最も clean な着地。
    4. 案 A は必要になった時(例: ESLint 9 に実害の大きい CVE が出た時、または eslint-config-next が ESLint 10 を要求してきた時)に即応可能な予備プランとして温存するのが合理的。

    運用:

    • 週次プローブは継続。watch 対象を拡張して以下も併せて監視:
      • vercel/next.js の eslint-config-next リリース
      • eslint-plugin-jsx-a11y の ESLint 10 対応 PR
      • eslint-plugin-import の ESLint 10 対応 PR
    • 次のトリガー: eslint-config-next が peer に eslint@^10 を明示(または eslint-plugin-react 8.x が cut される)した時点でフェーズ 2 実装に着手。
    • 予備プラン (A) 起動条件: 上記が 2026-12-31 までに揃わない場合、または ESLint 9 に高深刻度 CVE が出た場合、@eslint/compat PoC を最優先着手。

    6. 案 A を採用する場合の実装 Issue ドラフト(予備)

    予備として温存 — 起動条件が満たされた時に即起票できる形

    タイトル: chore(eslint): migrate to ESLint 10 via @eslint/compat shim

    要件:

    1. package.json: eslint を ^10.x に bump、@eslint/compat を devDep 追加。
    2. eslint.config.mjs: nextCoreWebVitals / nextTypescript を fixupConfigRules() でラップして export。
    3. package.json に overrides を追加(eslint-plugin-react / eslint-plugin-jsx-a11y / eslint-plugin-import の peer 警告を抑制する必要があれば)。
    4. CI で npm run lint がエラー件数変化なしで通ること。
    5. Playwright / Vitest テストは影響なしを確認。

    受け入れ条件:

    • eslint --version が 10.x を返す
    • npm run lint が baseline と同じエラー件数(現状 0 想定)で完了
    • npm run build が成功
    • npm run test / npm run test:e2e が成功
    • @eslint/compat の pin バージョンが lockfile に固定される

    smoke test:

    • lint 実行結果件数 baseline vs after
    • npm ci の EBADPEERDEP 有無

    7. 補足: 案 A の PoC を実際に走らせる場合の手順

    本 Actions では npm install が実行できないため、以下は次のアクションのメモです(thebotch M 層 or W 層が別セッションで実行想定):

    cd the-botch
    npm install --save-dev eslint@^10 @eslint/compat --legacy-peer-deps
    # eslint.config.mjs を fixupConfigRules 版に書き換え
    npx eslint . --max-warnings=0

    失敗パターン別の分岐:

    • peer 警告のみ: overrides で吸収可能。案 A 成立。
    • context.getScope is not a function 系: fixupConfigRules で救える可能性大。案 A 成立。
    • AST / rule schema 系エラー: fixup では救えず、upstream 対応待ち。案 C に自動フォールバック。

    結論

    • 短期(9/15〜9/30 期限対応): 案 C(ESLint 9 延命)を採用。実装 Issue は起票しない。
    • 中期(2026 年内): upstream watch を Next.js 側にも拡張して継続。
    • 予備: 案 A の実装 Issue ドラフトを本コメントに残置。起動条件が満たされ次第、chief / thebotch M 層の判断で即起票可能。
    • 不採用: 案 B(@eslint-react 切替)。ブロッカー 3 本のうち 1 本しか解決せず、工数対効果が悪い。

    推奨案 C はコード変更ゼロのため、本 Issue に紐づく PR は作成しません。フェーズ 2 実装 Issue(#114 系)の判断材料としてこの調査結果を活用してください。
    / branch: claude/issue-266-20260908-1447

  2. info-mnml commented on Sep 8, 2026

    @info-mnml
    CollaboratorAuthor

    調査完了・クローズ

    調査結果は本 Issue のコメント(2026-09-08)に記録済み。推奨案 C(ESLint 9 延命)を採用確定。

    判断過程:

    • 案 B(@eslint-react 切替): ブロッカー複数・工数大で却下
    • 案 A(@eslint/compat): 技術的に成立するが、eslint-config-next 側の対応も未完なため今すぐ移行しても再ブロックされる可能性が高い → 起動条件付きで温存
    • 案 C(延命): コード変更ゼロ・リスク最小。upstream + eslint-config-next が両方そろうまで待つ

    次アクション: 案 A 起動条件(9/30 期限超過 or CVE 発生)を满たした時点で、新 Issue として案 A 実装を起票する(ドラフトは本 Issue のコメントに保存済み)。

    再燃時は新 Issue 起票。本 Issue は close。

  3. added
    merged-unverified
    verified
    and removed
    merged-unverified
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2verified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions