[eslint-rules:applier] Adopt js-no-unguarded-async-write-after-effect-state-extraction in githubnext/gh-cao

オープン
#19,381 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
eslint, github-actions, javascript, node.js
領域
ci-cd, tooling

調査の方向性

Start with dashboard/site/eslint.config.mjs and the named component files, especially account-menu.js and configuration-view.js; compare their async writes with guarded examples in cli-actions.js and the other listed components. The issue specifies the new rule, script, CI job and validation commands, but adding a custom ESLint rule requires understanding its AST and scope checks. Done means the new script reports warnings only, the separate CI job runs it, and the existing lint, typecheck and tests pass.

索引モデルが issue の本文から書いたものです。

説明

eslint-rules eslint-rules:applier

Adopt the js-no-unguarded-async-write-after-effect-state-extraction ESLint rule in githubnext/gh-cao at warn severity only. The refiner measured 6 true positives and 0 false positives on this repository (commit 6c350917). Post-await state.set(...) writes in dashboard components skip the createFactoryScope().signal.aborted guard that sibling components already use.

Action: A maintainer should assign this issue to Copilot. Acceptance: npm run lint:eslint-factory in dashboard/site runs and reports only warnings, the new CI job runs only that script, and the existing lint, typecheck and tests still pass.

Critical findings
  • Adoption mode: extend. ESLint 9 flat config already exists in dashboard/site/eslint.config.mjs. The root config ignores dashboard/site/**, so the rule belongs in the dashboard config.
  • The rule detects an async handler that writes reactive state after an await without checking the component scope's abort signal. If the component unmounts first, the write lands on detached DOM.
  • Known unguarded sites (about 6): account-menu.js (switchAccount/logout finally blocks and .then() continuations) and configuration-view.js (diagnostics handler). Guarded counterparts exist in ui-primitives.js, table-region.js, data-view.js and cli-actions.js.
  • False-positive risk: page-scoped singletons that never unmount do not need the guard. The rule should only fire where a createFactoryScope() signal is in scope but unused after an await. Suppress with a justified // eslint-disable-next-line.
  • The rule source is not yet in this repository, so the agent must add it (see prompt).
Evidence and permalinks

Upstream merged PRs in githubnext/gh-aw-cao (plain text, not linked): 15419 ui-primitives.js (guarded); 15463 table-region.js (guarded, with tests); 15483 data-view.js (guarded, with test); 15434 account-menu.js (unguarded); 15475 configuration-view.js (unguarded).

Findings in this repository: dashboard/site/src/components/account-menu.js around lines 99, 130, 241, 255 and 270; dashboard/site/src/components/configuration-view.js around lines 308-315. Guard pattern: dashboard/site/src/components/cli-actions.js around lines 299, 342 and 348.

Affected paths: dashboard/site/src/components/{ui-primitives,table-region,data-view,account-menu,configuration-view}.js.

The rule is not autofixable. The manual fix is if (scope.signal.aborted) return; after each await, before the .set().

<b>Agent prompt</b>

In githubnext/gh-cao, adopt ESLint rule js-no-unguarded-async-write-after-effect-state-extraction at warning severity only. Change only these files:

  1. Add dashboard/site/eslint-rules/js-no-unguarded-async-write-after-effect-state-extraction.mjs. The rule flags <state>.set(...) calls that follow an await in an async function when a createFactoryScope() scope is in lexical scope and scope.signal.aborted was not checked between them. It must not be autofixable.
  2. Edit dashboard/site/eslint.config.mjs to register the rule as a local plugin with severity warn only. Do not change existing rule severities or enable unrelated rules.
  3. Edit dashboard/site/package.json to add the script lint:eslint-factory, which runs ESLint over src/components with only this rule enabled and no other behaviour changes. Do not change the existing lint script.
  4. Edit .github/workflows/cid.yml to add one NEW job named ESLint Factory (warn-only) that checks out, sets up Node 24, runs npm ci, then runs npm run lint:eslint-factory in dashboard/site. Do not add it to an existing job, and do not make it merge-gating.

Do not do unrelated refactoring or dependency upgrades. Do not suppress or fix existing findings. If a finding cannot be fixed or understood, stop and report it rather than silencing it. Report the resulting warning count per path.

Validate with, from dashboard/site: npm ci && npm run lint:eslint-factory && npm run lint && npm run typecheck && npm test.

Control Plane

cao: githubnext/gh-cao, correlation: 39671466559-562

Generated by 🎯 ESLint Factory / Applier · copilot · auto · 32.7 AIC · ⌖ 0.826 AIC · ⊞ 16.7K · ◷

  • expires on Nov 20, 2026, 8:43 PM UTC
主要言語
JavaScript
スター
14
フォーク
5
平均マージ
3時間 24分
マージ済み PR(30日)
796

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

githubnext/gh-cao のほかの issue

githubnext/gh-cao の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。