Cursor rule
.cursor/rules/typescript-standards.mdcCursor rules
Quality
61/100
Scores the file, not the repository.Length
286 words
8 headings · 1 code blocksRepository
0
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# TypeScript Standards23## Strict TypeScript Requirements45- Always use strict TypeScript mode6- Never use `any` type - use proper type definitions7- Use `unknown` instead of `any` when type is truly unknown8- Always define proper interfaces and types for props, state, and API responses910## Type Definitions1112- Define types in `src/types/` directory13- Use descriptive type names (e.g., `ProductListing`, `UserProfile`)14- Export types from dedicated type files15- Use union types for finite sets of values16- Prefer `interface` for object shapes, `type` for unions/intersections1718## Component Props1920- Always define `Props` interface for component props21- Use `React.FC<Props>` or `React.ComponentProps<"div">` for component typing22- Make props required unless they have default values23- Use proper event types (e.g., `React.ChangeEvent<HTMLInputElement>`)2425## Enum Usage2627- Always use enums from `src/constants/enums.ts` for consistent values28- Never hardcode string values that exist in enums29- Use enum values for API calls, form validation, and conditional logic30- Export enum types for use in other files3132## Context Typing3334- Define proper types for context values and setters35- Use `createContext<T>` with proper generic types36- Define context provider props interface37- Use proper typing for context consumers3839## API and Service Types4041- Define types for all API request/response shapes42- Use proper typing for Supabase operations43- Define error types and handle them appropriately44- Use generic types for reusable service functions4546## Example Patterns4748```typescript49// Good: Proper interface definition50interface ProductCardProps {51 product: Product;52 onAddToCart: (productId: string) => void;53 variant?: "default" | "compact";54}5556// Good: Using enums57const status = LISTING_STATUS.APPROVED;5859// Good: Proper event typing60const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {61 setValue(e.target.value);62};63```6465description:66globs:67alwaysApply: false6869---70
Also in KAMAL20201/SneakerMarketplace
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| KAMAL20201/SneakerMarketplace.cursor/rules/api-patterns.mdc · 0 | Cursor rules | styletypessecuritydatabase+1 | 58/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplace.cursor/rules/development-workflow.mdc · 0 | Cursor rules | buildteststyletypes+4 | 81/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplace.cursor/rules/project-conventions.mdc · 0 | Cursor rules | buildteststylearch+4 | 77/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplace.cursor/rules/project-overview.mdc · 0 | Cursor rules | stylearchtypes | 52/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplace.cursor/rules/react-patterns.mdc · 0 | Cursor rules | stylearchuiperformance | 58/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplace.cursor/rules/ui-components.mdc · 0 | Cursor rules | archui | 54/100 | 3 days ago | |
| KAMAL20201/SneakerMarketplaceAGENTS.md · 0 | AGENTS.md | stylesecuritydo-not | 45/100 | 3 days ago |
Diff against .cursor/rules/api-patterns.mdc Diff against .cursor/rules/development-workflow.mdc Diff against .cursor/rules/project-conventions.mdc Diff against .cursor/rules/project-overview.mdc Diff against .cursor/rules/react-patterns.mdc Diff against .cursor/rules/ui-components.mdc Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
