TypeScript 严谨实现规则
约束 Cursor 在 TS 项目中优先类型安全、小 diff 和补测试。
Cursor RuleCursor Rules / .cursor/rules
description: Prefer typed, small, test-backed TypeScript changes globs: **/*.{ts,tsx} alwaysApply: false
TypeScript implementation
- Do not use
any. Prefer unknown + narrowing. - Keep diffs small; do not refactor unrelated files.
- When changing behavior, add or update a unit test.
- Match existing import style and path aliases.
- Explain the risk of the change in one short paragraph.