32 lines
No EOL
625 B
Markdown
32 lines
No EOL
625 B
Markdown
# 强制依赖项文档块格式 (dependency-group)
|
|
|
|
确保所有顶级包汇入遵循依赖项分组约定。
|
|
|
|
具体来说,这确保:
|
|
|
|
- 根据汇入来源,在汇入前添加适当的“外部依赖项”或“内部依赖项”注释。
|
|
|
|
## 规则详情
|
|
|
|
此规则的**错误**代码示例:
|
|
|
|
```js
|
|
import { get } from 'lodash';
|
|
import { Component } from '@wordpress/element';
|
|
import edit from './edit';
|
|
```
|
|
|
|
此规则的**正确**代码示例:
|
|
|
|
```js
|
|
/*
|
|
* 外部依赖项
|
|
*/
|
|
import { get } from 'lodash';
|
|
import { Component } from '@wordpress/element';
|
|
|
|
/*
|
|
* 内部依赖项
|
|
*/
|
|
import edit from './edit';
|
|
``` |