| 
				
					 | 
			3 years ago | |
|---|---|---|
| .. | ||
| __tests__ | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| src | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| .eslintrc.json | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| README-zh_CN.md | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| README.md | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| package.json | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
| tsconfig.json | afc602924a chore: add eslint-plugin-semi-design | 3 years ago | 
Semi 仓库使用的 eslint 插件
semi-ui 不应该作为 semi-foundation 的依赖。
原因:根据 Semi 的 foundation 和 adapter 设计,foundation 不应依赖 adapter。点击查看 F/A 设计。
使用 lodash 而不是 lodash-es。
原因:为了兼容 next,而 lodash-es 只提供了 es module 的产物。
点击查看详情。
monorepo 下各个包之间的 import 请使用包名而不是相对路径。
原因:这两个包在用户项目的安装路径可能不在同一文件夹下,使用相对路径会找不到对应的包。
// ❌ 不推荐
// semi-ui/input/index.tsx
import inputFoundation from '../semi-foundation/input/foundation';
// ✅ 推荐
// semi-ui/input/index.tsx
import inputFoundation from '@douyinfe/semi-foundation/input/foundation';
同一个包 import 请使用相对路径而不是引用包名。
// ❌ 不推荐
// semi-ui/modal/Modal.tsx
import { Button } from '@douyinfe/semi-ui';
// ✅ 推荐
// semi-ui/modal/Modal.tsx
import Button from '../button';
