Declarative .mdcกฎ Cursor/Claude/Windsurf และเวิร์กโฟลว์ n8nกฎ IDEตรวจสอบการรั่วไหลแบบ Zero-Secret แล้ว

TypeScript 5.8 โหมดเข้มงวด กฎการตรวจสอบความถูกต้องเป็นศูนย์และขอบเขต

กฎ IDE ที่ประกาศบังคับใช้ strictNullChecks, noUncheckedIndexedAccess, สหภาพที่เลือกปฏิบัติ และการแยกวิเคราะห์ขอบเขต JSON รันไทม์ข้าม monorepos TypeScript

ไฟล์กฎตัวแทนและ IDE ที่ประกาศ

---
description: TypeScript 5.8 strict type-safety, discriminated unions, and zero-any API boundaries
globs: **/*.{ts,tsx}
alwaysApply: true
---

# TypeScript 5.8 Strict Type-Safety Constitution

- Enable `"strict": true`, `"noUncheckedIndexedAccess": true`, and `"noImplicitOverride": true` in every `tsconfig.json`.
- NEVER use `any` or double-cast `as unknown as T`; type untrusted network/JSON inputs as `unknown` and narrow with explicit schema validators.
- Model async UI states and domain events as discriminated unions (`{ status: 'loading' } | { status: 'ok'; data: T } | { status: 'error'; message: string }`).
- Use `import type { ... }` for type-only imports so bundlers elide compile-time declarations deterministically.
- Enforce exhaustive `switch` checks using a `never` helper in `default` branches.

## Verification Check
```bash
npx tsc --noEmit --pretty false
```

หมายเหตุการตั้งค่าชุมชนและบทวิจารณ์การผลิต (0)

ยังไม่มีบันทึกของชุมชน แบ่งปันเคล็ดลับการกำหนดค่าการใช้งานจริงของคุณด้านล่าง

โพสต์บันทึกการตั้งค่าหรือเคล็ดลับการยืนยัน

เครื่องมือ MCP ที่เปิดเผยและตัวตรวจสอบสคีมาทรัพยากร

เครื่องมือ / ตัวระบุทรัพยากรพารามิเตอร์อินพุตพฤติกรรมการดำเนินการ
forbid_explicit_any**/*.{ts,tsx}Replaces any and unsafe as casts with unknown + narrowed type guards.