Skip to content

Commit 41364ec

Browse files
committed
Add rules/typescript-strict-production/.cursorrules
1 parent 353307f commit 41364ec

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.cursorrules — TypeScript Strict Mode
2+
3+
- tsconfig.json must have "strict": true. Never disable strict checks.
4+
- No any. Use unknown + type guards, or as Type only at I/O boundaries.
5+
- Every exported function needs explicit return type including async (Promise<T>).
6+
- Model state as discriminated unions: { status: "loading" } | { status: "success"; data: T }.
7+
- Readonly<T> for immutable data. as const for config objects.
8+
- Validate env vars at startup. Never process.env.FOO in business logic.
9+
- No TypeScript enum. Use const object + typeof union.

0 commit comments

Comments
 (0)