error-handling-completeness: await-to-try ratio instead of floating promises; entry points from package.json not read

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
49/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, typescript
領域
cli, testing-qa

調査の方向性

Start with error-handling-completeness.ts around lines 113–121 and inspect the audit engine’s handling of thrown law failures. Then read src/cli.ts and the package.json bin and main entries to trace CLI entry points. Compare the audit results after handling comments and strings, and confirm that genuinely floating promises are flagged while handled awaits and the CLI’s error paths are accounted for; the policy for try-around-parse remains a maintainer decision.

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

説明

bug

Found in the 8.0.0 self-audit triage: RoC 7.29.1 (npm, 5fc54afe) on a clean clone of develop at 2d2fa9a, with typescript resolvable (verdict compliance, 0 failed / 46 warnings). The bucket method and per-law tables are kept by QA; counts are from that run.

What happens

The law flags a file when await \w+ count exceeds 4 × (try{ + .catch() count) on the raw text (error-handling-completeness.ts:113-121). Once comments and strings are removed, 33 findings become 4, and those 4 are real awaits whose rejection is caught (inside a try in the same file, or by the caller — the audit engine turns a thrown law into a failed result). The global-handler check only looks at fixed file names and never at the source of the package's bin entry (src/cli.ts), which has a try around program.parse() and a catch in every action.

Suggested direction

Flag floating promises (not awaited, not returned, no .catch), and treat an await inside a try block as handled; resolve entry points from package.json bin/main. Whether try-around-parse plus per-action catch counts as global handling for a CLI is a maintainer decision.

主要言語
TypeScript
スター
0
フォーク
0
平均マージ
38分
マージ済み PR(30日)
96

環境構築

はじめの一歩

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

Rule-Of-Code/RoC のほかの issue

Rule-Of-Code/RoC の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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