Files
geg-gas-web/.claude/commands/check-convention.md

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

检查当前修改或指定的 Vue/TS 文件是否符合本项目代码规范。
## 检查项
### Vue 组件
- 新文件是否使用 `<script setup lang="ts">`
- 事件处理函数是否以 `handle` 开头
- 弹窗/子组件文件名是否为 PascalCase页面入口是否为 `index.vue`
### 路径
- 是否使用 `/@/` 别名,禁止出现 `../../` 相对路径
### 国际化
- 用户可见文本是否通过 `useI18n``t()` 处理,禁止硬编码中文字符串
### 表格页面
- 是否使用 `PageWrapper` + `BasicTable` + `useTable` + `useModal` 标准结构
### API 模块
- 请求是否通过 `defHttp`,禁止直接使用 axios
- 接口路径是否用 `enum Api` 管理
### 样式
- 组件内样式是否使用 `<style lang="less" scoped>`
- AntD 组件穿透是否使用 `:deep()` 而非直接穿透
### 权限
- 操作按钮是否通过 `v-auth``usePermission` 控制
## 输出格式
1. **问题列表**:按检查项分类列出不符合规范的地方,标注文件名和行号
2. **修改建议**:针对每个问题给出具体修改方案
3. **如无问题**:输出"符合规范 ✓"