Copilot configuration for strict TypeScript development.
# GitHub Copilot TypeScript Configuration
## Type Safety
When generating TypeScript code:
- Enable strict mode
- Never use 'any'
- Use proper generics
- Define interfaces for objects
## Patterns
```typescript
// Prefer interfaces
interface User {
id: string;
email: string;
role: 'admin' | 'user';
}
// Use generics
function findById<T extends { id: string }>(items: T[], id: string): T | undefined {
return items.find(item => item.id === id);
}
// Type guards
function isUser(value: unknown): value is User {
return (
typeof value === 'object' &&
value !== null &&
'id' in value &&
'email' in value
);
}
```
## Utility Types
- Use Partial<T> for optional updates
- Use Pick<T, K> for selecting fields
- Use Omit<T, K> for excluding fields
- Use Record<K, V> for dictionariesCursor 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.
Copilot
general
AI coding rules customize how GitHub Copilot generates and refactors code for your project. Follow these steps to install GitHub Copilot TypeScript Standards.
.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.