ant-design/.cursor/rules/project.mdc
afc163 79425c5dc1
chore: more cursor rules (#53224)
* feat: add cursor rules in .cursor/rules

* docs: add non-component changelog rule

* docs: update cursor rules format

* feat: update cursor rules

* refactor: remove duplicated styles.mdc

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Delete .cursor/rules/component.mdc

Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Delete pr_template.txt

Signed-off-by: afc163 <afc163@gmail.com>

* Delete .cursorrules

Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

* Update .cursor/rules/project.mdc

Signed-off-by: afc163 <afc163@gmail.com>

* Update project.mdc

Signed-off-by: afc163 <afc163@gmail.com>

* Delete .cursor/rules/implementation.mdc

Signed-off-by: afc163 <afc163@gmail.com>

* Update project.mdc

Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Signed-off-by: afc163 <afc163@gmail.com>

* feat: add server-side rendering guidelines

* update

* update

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-03-21 06:37:25 +00:00

27 lines
839 B
Text
Raw Permalink 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.

---
description:
globs:
alwaysApply: true
---
# 项目背景
这是 ant-design/ant-designantd的源代码仓库是一个 React 组件库,发布为 npm 包 antd。
- 使用 TypeScript 和 React 开发
- 兼容 React 16 ~ 19 版本
- 组件库设计精美,功能完善,广泛应用于企业级中后台产品
- 遵循 Ant Design 设计规范
- 支持国际化
# 编码规范
- 使用 TypeScript 和 React 书写
- 使用函数式组件和 hooks避免类组件
- 使用提前返回early returns提高代码可读性
- 避免引入新依赖,严控打包体积
- 兼容 Chrome 80+ 浏览器
- 支持服务端渲染
- 保持向下兼容,避免 breaking change
- 组件名使用大驼峰PascalCase
- 属性名使用小驼峰camelCase
- 合理使用 React.memo、useMemo 和 useCallback 优化性能