Skip to content

Cursor Rule for TypeScript Language

mdc
---
globs: *.ts,*.dts,*.mts
alwaysApply: false
---
This rule provides the development specifications of the TypeScript language

## Code Style and Structure

- always use `const` to declare ordinary variables that will not be copied
- always use `let` to define ordinary variables that will be copied
- try to use **arrow functions** instead of **Function declarations**
- try to use `interface` instead of `type` definition declaration
- try to use `satisfies` instead of `as`
- avoid using `any` type

## Name Conventions

- normal variable and function names always use **camelCase** (e.g. cacheKey)
- constant names use **UPPER_SNAKE_CASE** (e.g. GLOBAL_CONFIG)