RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/Kele-Bingtang/teek-design-vue3

Cursor rule

.cursor/rules/structure.mdc

组件结构规范

Cursor rules

Quality

56/100

Scores the file, not the repository.

Length

158 words

8 headings · 0 code blocks

Repository

273

— · pushed 9 days ago

Last changed

3 days ago

First indexed 3 days ago.
Kele-Bingtang/teek-design-vue3/.cursor/rules/structure.mdcRawGitHub
1---
2description: 组件结构规范
3globs:
4alwaysApply: true
5priority: 999
6---
7 
8您是一位注重文件存放、文件命名、代码规范的前端开发专家。
9 
10## 文件组织
11 
121. 通用组件(components)请放到 `src/components/` 目录下,且按功能分子文件夹,比如 `card/`、`chart/`、`pro/`
132. 通用可复用逻辑(composables)放在 `src/composables/`
143. 通用样式放在 `src/common/styles/`
154. 通用 API 请求相关文件放在 `src/common/api/`
165. 通用工具函数放在 `src/common/utils/`
176. Typescript 类型文件请在组件同级目录下创建 `types.ts` 或者 types 目录,且
187. 上述非通用文件请在组件同级目录创建,如 `src/views/lgoin` 下有 `index.vue`、`components`、`composables`、`api` 等
19 
20## 命名规范
21 
221. 所有文件请使用 `kebab-case` 风格,如 `pro-table.vue`、`use-table.ts`、`pro-table.scss`
232. 引入组件的命名为 `Camel-Case`,如 `import ProTable from "pro-table.vue"`
243. TypeScript 接口和类型用 PascalCase,统一放在同级目录 `types.ts` 或 `types/xx.ts` 文件中,且组件里的 Typescript 类型移到类型文件里,如 `ProTableProps`、`ProTableEmits`
25 
26## TypeScript 使用
27 
281. 所有函数参数都要加类型注解,如果返回值可以推导则不需要添加
292. 全局类型放在 `src/types/`,模块专用类型
30 
31## 导入与导出
32 
331. 使用以 `@/` 为根的绝对路径导入(如 `import { ProTable } from '@/components/pro/table'`),如果是样式文件,则以 `@styles` 代替 `@/common/styles` 目录
342. 每个组件目录下用 `index.ts` 统一导出,便于批量导入
35 
36## 代码结构
37 
381. 新组件统一使用 `<script setup lang="ts">` 语法
392. props、emits、composables 写在 script 顶部
403. 使用 defineProps 和 defineEmits 宏定义属性和事件,用法如 `defineProps<{ts 类型}>();`、`defineEmits<{xx: []}>`,这些请用 Typescript 的 `interface` 定义
414. 不推荐 `props`、`emits`、`响应式变量`、`computed`、`watch`、`function`、`生命周期` 的结构写法,请使用可复用逻辑(composables)写法,即将关联性高的代码放到 `function useXx` 里然后暴露出来使用
425. 使用 `defineModel` 代替 `props.modelValue`
436. 适当换行,如变量与函数之间,`script`、`template`、`style` 标签之间必须换行
44 
45## 代码规范
46 
471. 使用 ESLint 和 Prettier 保证代码风格统一
482. 遵循 `eslint.config.js` 中的规则
49 
50## 文档规范
51 
521. composable 和函数用 JSDoc 或 TypeScript 注释说明用途
53 
54## Git 版本管理
55 
561. 不要提交构建产物和本地环境配置文件
572. TODO.md 及时记录和更新待办事项
58 

Commands it names

  • eslint.config.js

Sections

  • 文件组织
  • 命名规范
  • TypeScript 使用
  • 导入与导出
  • 代码结构
  • 代码规范
  • 文档规范
  • Git 版本管理

What it covers

lint-formattypesgit-prdocs

Stack — with the evidence

typescript

(1.00)

eslint

(1.00)

node

(0.70)

vue

(0.70)

vite

(0.70)

javascript

(0.60)

pnpm

(0.60)

vercel

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
Kele-Bingtang
Language
—
License
—
Archived
no

All configs in this repo

Also in Kele-Bingtang/teek-design-vue3

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
Kele-Bingtang/teek-design-vue3.cursor/rules/code.mdc · 273Cursor rulestypescripteslint+6no sections45/1003 days ago
Kele-Bingtang/teek-design-vue3.cursor/rules/ui.mdc · 273Cursor rulestypescripteslint+6no sections16/1003 days ago
Kele-Bingtang/teek-design-vue3.cursorrules · 273.cursorrulestypescripteslint+6lint-formatuidocs48/1003 days ago
Diff against .cursor/rules/code.mdc Diff against .cursor/rules/ui.mdc Diff against .cursorrules

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack