Declarative .mdcCursor/Claude/Windsurf 规则和 n8n 工作流程IDE规则零秘密泄漏审计

TypeScript 5.8 严格模式、零任意和边界验证规则

声明性 IDE 规则在 TypeScript monorepos 上强制执行 strictNullChecks、noUncheckedIndexedAccess、可区分联合和运行时 JSON 边界解析。

声明性代理和 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.