Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components rules #3

Open
laozhu opened this issue Dec 27, 2018 · 1 comment
Open

Components rules #3

laozhu opened this issue Dec 27, 2018 · 1 comment
Labels
rules Rules discussed here

Comments

@laozhu
Copy link
Contributor

laozhu commented Dec 27, 2018

为保证每一个组件独立,不相互依赖,需要遵守下面规则:

  1. 组件仅允许引入已定义的公共样式和组件样式
  2. 组件需严格定义接口参数类型及其默认值
  3. 组件需包含文档,约定位于组件目录下 readme.md 文件
  4. 组件需包含测试用例,约定位于 __tests__ 目录下
  5. 组件中可引入流行的工具类库(如:lodash, classnames 等)
  6. 引入工具类库的组件单独打包时需抽离依赖,写入 package.json
  7. 代码风格需遵守 @pubean/eslint-config@pubean/stylelint-config
  8. 如对代码风格有异议,可先提出讨论后修改规则
  9. 使用不符合浏览器兼容性要求特性需在 package.json 中明确添加忽略

@chekun

@laozhu laozhu added the rules Rules discussed here label Dec 27, 2018
@chekun
Copy link
Contributor

chekun commented Dec 28, 2018

应该对 eslint 和 stylelint 实现单独的命令,留待整合CI的时候进行执行,实现风格的一致性约束

- yarn stylelint
- yarn eslint
- yarn test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules Rules discussed here
Projects
None yet
Development

No branches or pull requests

2 participants