本文へスキップ
Skillpedia
一般的なプログラミング75k · #3068

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/typescript-strict-mode/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3068
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル