chore: apply TypeScript/ESLint setup guide - #35
Merged
Conversation
tsconfig: enable the guide's non-strict-included flags that measured 0 errors. Flags that still report errors are left off and listed in the PR. eslint: - tseslint strict + stylistic (consistent-type-assertions lives only in stylistic) - lint .tsx as well; React sources were matched by no config and went unlinted - type-aware rules via a lint-only tsconfig.eslint.json, since the build tsconfigs do not cover every linted file - no-undef off for TS (TypeScript checks it; it flags type-only references) - rules with existing violations start at warn so CI stays green Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TypeScript / ESLint 設定ガイド をこのリポジトリに適用した。
ガイド §5「既存プロジェクトの導入順序」に従い、違反 0 件のものだけ即
error、既存違反があるものはwarnで導入している。CI は緑のまま。Items to Confirm / Review
tsconfig.eslint.jsonを新規追加した — 型情報 ESLint ルール専用。build 用 tsconfig は lint 対象の全ファイルを include していないため、projectにそれを指定すると当該ファイルがパースエラーになる。build には影響しない(参照するのは eslint のみ)。.tsxが今まで一度も lint されていなかった — 旧files: ["**/*.ts", "**/*.vue"]はどの.tsxにもマッチしない。**/*.tsxを追加したので React 側が新規に lint 対象になった。no-undefを off にした — 型としてのみ使う参照(React.FormEvent等)を "not defined" と誤検出するため。TypeScript 自身が検出するので二重チェックは不要(typescript-eslint のeslint-recommendedも同じ扱い)。@typescript-eslint/no-explicit-anyの既存のoff/warn設定は削除した — ガイドがerrorを要求するため。違反が残っている場合のみwarnに落としてある。tsconfig
各フラグを個別に入れてエラー件数を実測し、0 件のものだけ有効化した(ガイド §1「件数を測ってから決める」)。
tsconfig.jsonuseUnknownInCatchVariablesnoImplicitOverridenoImplicitReturnsnoUncheckedIndexedAccessnoPropertyAccessFromIndexSignatureexactOptionalPropertyTypesESLint
tseslint.configs.strict+tseslint.configs.stylisticを導入(
asを禁止するconsistent-type-assertionsは stylistic にしか入っていない — ガイド §2 の罠)no-floating-promises/no-misused-promises/await-thenable/no-base-to-string(
parserOptions.projectが無いとルールが動きさえしない)strictTypeCheckedは丸ごと入れず、ガイドの指示どおりルールを名指しで追加warn で入れたもの
既存違反があるため warn で導入(= 返すべきバックログ)。CI は緑のまま件数だけ見える。
@typescript-eslint/await-thenable@typescript-eslint/consistent-type-assertions@typescript-eslint/no-explicit-any@typescript-eslint/no-floating-promises検証
User Prompt
対象は GUIChatPlugins 配下の 36 リポジトリ、適用強度は「0 件のフラグのみ即適用、残りは warn」、レビューは
/code-reviewのローカル実行、と確認済み。設定パターンはGUIChatPluginTemplate#29でレビュー済みのものを全リポに展開している。🤖 Generated with Claude Code