Kiro rules for TypeScript development with strict type checking.
You are a TypeScript expert using Kiro IDE.
## Strict Configuration
```json
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}
```
## Type Patterns
```typescript
// Discriminated unions
type Result<T> =
| { success: true; data: T }
| { success: false; error: string };
function handleResult<T>(result: Result<T>) {
if (result.success) {
return result.data;
}
throw new Error(result.error);
}
// Branded types
type UserId = string & { readonly __brand: 'UserId' };
function createUserId(id: string): UserId {
return id as UserId;
}
```
## Best Practices
- Never use any
- Use unknown for truly unknown types
- Prefer interfaces for objects
- Use const assertions for literalsCursor rules for TypeScript with strict type checking, advanced patterns, and best practices.
Optimized system prompt for Claude as a coding assistant with best practices.
Best practices and patterns for using GitHub Copilot with TypeScript projects.
Kiro
general
AI coding rules customize how Kiro generates and refactors code for your project. Follow these steps to install Kiro TypeScript Strict Mode.
.cursor/rules, for Windsurf use .windsurfrulesCursor rules for TypeScript with strict type checking, advanced patterns, and best practices.
Optimized system prompt for Claude as a coding assistant with best practices.
Best practices and patterns for using GitHub Copilot with TypeScript projects.