Sign in
Explore
Prompts · RulesEveryday codingWeb & UIReviewed

typescript

TypeScript coding standards: the type system and conventions for modern web development.

Kind
Rules
Works with
Cursor
Languages
TypeScript / JavaScript
Source
Awesome Cursor Rules @ b044f956f021
Path
rules/typescript.mdc
Jobs
Implementation

Credit

Made by
PatrickJS
Original
github.com/PatrickJS/awesome-cursorrules/blob/b044f956f021b6e…
License
CC0-1.0

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • Text to merge into your CLAUDE.md or AGENTS.md (no new files)
Runs scripts
None found
Uses the network
None found
Needs secrets
None found
Source revision
b044f956f021
Licence
CC0-1.0
Last activity
30 May 2026
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

# TypeScript Best Practices

## Type System
- Prefer interfaces over types for object definitions
- Use type for unions, intersections, and mapped types
- Avoid using `any`, prefer `unknown` for unknown types
- Use strict TypeScript configuration
- Leverage TypeScript's built-in utility types
- Use generics for reusable type patterns

## Naming Conventions
- Use PascalCase for type names and interfaces
- Use camelCase for variables and functions
- Use UPPER_CASE for constants
- Use descriptive names with auxiliary verbs (e.g., isLoading, hasError)
- Prefix interfaces for React props with 'Props' (e.g., ButtonProps)

## Code Organization
- Keep type definitions close to where they're used
- Export types and interfaces from dedicated type files when shared
- Use barrel exports (index.ts) for organizing exports
- Place shared types in a `types` directory
- Co-locate component props with their components

## Functions
- Use explicit return types for public functions
- Use arrow functions for callbacks and methods
- Implement proper error handling with custom error types
- Use function overloads for complex type scenarios
- Prefer async/await over Promises

## Best Practices
…