Langsung ke konten
Skillpedia
Pemrograman umum75k · #3068

typescript-strict-mode

Fungsinya

Skill ini memeriksa pengaturan proyek TypeScript dan mengaktifkan pemeriksaan tipe yang ketat. Skill ini cocok untuk developer yang ingin kompiler menangkap lebih banyak bug sebelum kode dijalankan.

Kapan dipakai

  • ✓Saat proyek TypeScript tidak memiliki pengaturan ketat di tsconfig.json.
  • ✓Saat basis kode memiliki error null atau tipe any tersirat.
  • ✓Saat memulai proyek TypeScript baru dan memilih pengaturan yang paling aman.

Link skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/typescript-strict-mode/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/typescript-strict-mode/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Saya punya proyek TypeScript. Bisakah Anda memeriksa tsconfig saya dan mengaktifkan mode ketat jika aman?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent membaca file tsconfig dan memeriksa flag ketat mana yang sudah aktif. Agent mengaktifkan yang belum ada, atau mengaktifkannya bertahap jika kode yang ada memiliki banyak error.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Apa saja yang diaktifkan mode ketat?

Mode ini mengaktifkan sekelompok pemeriksaan, termasuk strictNullChecks dan noImplicitAny, yang menangkap bug umum.

Bagaimana jika proyek saya memiliki banyak error tipe?

Skill menyarankan mengaktifkan strictNullChecks terlebih dahulu, lalu flag lainnya satu per satu.

Apakah lebih mudah memulai dengan mode ketat?

Skill menyatakan mengaktifkan mode ketat sejak awal jauh lebih mudah daripada menyesuaikannya ke proyek besar nanti.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
75k
Peringkat
#3068
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa