typescript-strict-mode
できること
このスキルは、TypeScript プロジェクトの設定を確認し、厳密な型チェックを有効にします。コンパイラにより多くのバグを実行前に見つけてほしい開発者向けです。
使う場面
- ✓TypeScript プロジェクトの tsconfig.json に strict の設定がないとき。
- ✓コードベースに null のエラーや暗黙の any があるとき。
- ✓新しい TypeScript プロジェクトで、最も安全な設定を選びたいとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/typescript-strict-mode/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“TypeScript のプロジェクトがあります。tsconfig を確認して、安全であれば strict モードを有効にしてもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは tsconfig ファイルを読み、どの strict のフラグが有効かを確認します。不足しているフラグを有効にします。既存のコードにエラーが多い場合は、段階的に有効にします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Enable TypeScript strict mode in tsconfig.json
Without strict mode, TypeScript allows implicit any types, ignores possible null/undefined values, and silently accepts unsound function assignments — meaning the type system gives a false sense of safety. Enabling strict mode makes TypeScript catch the bugs it was designed to prevent, turning type errors into compile-time failures rather than runtime surprises in production.
Quick Reference
- "strict": true enables strictNullChecks, noImplicitAny, and six other checks
- Enable strict from project start — retrofitting a large codebase is painful
- On existing projects: enable strictNullChecks first, then other flags incrementally
- Strict mode eliminates entire classes of null reference and implicit-any bugs
Check
Inspect the tsconfig.json in this project and report whether "strict": true (or individual strict flags) is enabled. List any missing strict flags.
Fix
Add "strict": true to the compilerOptions in tsconfig.json. If the project has existing type errors, explain how to enable strictNullChecks first as a stepping stone.
Explain
Explain what TypeScript strict mode enables, which individual flags it activates, and why each flag matters for catching real bugs.
Code Review
Check whether the codebase relies on implicit any, unchecked null access, or loose function type assignments that strict mode would reject. Flag the specific patterns and show what stricter types would look like.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/typescript-strict-mode
よくある質問
strict モードは何を有効にしますか?
strictNullChecks や noImplicitAny など、よくあるバグを見つける一連のチェックを有効にします。
型エラーが多い場合はどうしますか?
まず strictNullChecks を有効にし、その後ほかのフラグを一つずつ有効にすることを勧めています。
最初から strict にするほうが簡単ですか?
はい。大きなプロジェクトに後から導入するより、最初から strict モードにするほうがずっと簡単だとこのスキルは説明しています。
詳細
作者による元の説明
Use when setting up a new TypeScript project, auditing an existing tsconfig.json, or reviewing code where null-reference errors or implicit any types are present.
人気
- GitHubのスター
- 75k
- ランキング
- #3068
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。