Declarative .mdcReglas Cursor/Claude/Windsurf y flujos de trabajo n8nRegla IDEFuga de secreto cero auditada

TypeScript 5.8 Modo estricto, cero-cualquiera y reglas de validación de límites

Regla declarativa del IDE que aplica estrictosNullChecks, noUncheckedIndexedAccess, uniones discriminadas y análisis de límites JSON en tiempo de ejecución en monorepos TypeScript.

Agente declarativo y archivos de reglas 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
```

Notas de configuración de la comunidad y reseñas de producción (0)

Aún no hay notas comunitarias. Comparta su consejo de configuración de producción a continuación.

Publicar una nota de configuración o un consejo de verificación

Inspector de esquema de recursos y herramientas MCP expuesto

Identificador de herramienta/recursoParámetros de entradaComportamiento de ejecución
forbid_explicit_any**/*.{ts,tsx}Replaces any and unsafe as casts with unknown + narrowed type guards.