✨ feat(typescript): add standards docs and sync rewrite coverage
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# TypeScript 工具链
|
||||
|
||||
本 Playbook 推荐以下工具保证代码一致性与质量:
|
||||
|
||||
- `typescript`:编译器(`tsc`)
|
||||
- `prettier`:格式化
|
||||
- `eslint`:风格检查与静态分析(配合 `@typescript-eslint`)
|
||||
- `vitest` / `jest`:测试(按项目选择)
|
||||
- `tsx` / `ts-node`:直接运行 `.ts` 文件(开发/脚本场景)
|
||||
|
||||
## 常用命令(示例)
|
||||
|
||||
安装工具(按项目实际包管理器调整):
|
||||
|
||||
```bash
|
||||
pnpm add -D typescript prettier eslint typescript-eslint
|
||||
```
|
||||
|
||||
类型检查:
|
||||
|
||||
```bash
|
||||
tsc --noEmit
|
||||
```
|
||||
|
||||
格式化:
|
||||
|
||||
```bash
|
||||
prettier --write .
|
||||
```
|
||||
|
||||
Lint 检查:
|
||||
|
||||
```bash
|
||||
eslint .
|
||||
```
|
||||
|
||||
运行测试:
|
||||
|
||||
```bash
|
||||
vitest run
|
||||
# 或
|
||||
jest --ci
|
||||
```
|
||||
|
||||
## 包管理器
|
||||
|
||||
优先使用仓库已有的包管理器(`pnpm` / `npm` / `yarn`);未经沟通不切换。
|
||||
Reference in New Issue
Block a user