Declarative .mdcCursor/Claude/Windsurf-regler og n8n-arbejdsgangeIDE-regelNul-hemmelig lækage revideret
TypeScript 5.8 streng tilstand, nul-alle og grænsevalideringsregler
Deklarativ IDE-regel, der håndhæver strictNullChecks, noUncheckedIndexedAccess, diskriminerede fagforeninger og runtime JSON-grænseparsing på tværs af TypeScript monorepos.
Deklarativ agent og IDE-regelfiler
---
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
```Noter til fællesskabsopsætning og produktionsanmeldelser (0)
Ingen fællesskabsnotater endnu. Del dit produktionskonfigurationstip nedenfor.
Udsat MCP Tools & Resource Schema Inspector
| Værktøj/ressourceidentifikator | Input parametre | Udførelsesadfærd |
|---|---|---|
| forbid_explicit_any | **/*.{ts,tsx} | Replaces any and unsafe as casts with unknown + narrowed type guards. |