Declarative .mdcقواعد Cursor/Claude/Windsurf وسير العمل n8nقاعدة IDEتم تدقيق التسرب السري الصفري
TypeScript 5.8 الوضع الصارم وقواعد التحقق من صحة الحدود والصفر
قاعدة IDE التعريفية التي تفرض إجراءات صارمة لفحص NullChecks، وnoUncheckedIndexedAccess، والاتحادات التمييزية، وتحليل حدود JSON لوقت التشغيل عبر TypeScript monorepos.
الوكيل التعريفي وملفات قواعد 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. |