Skip to content

Commit

Permalink
docs: updated usage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
muxiangqiu committed May 4, 2024
1 parent 7c9049c commit 336dc14
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,30 +72,29 @@ yarn add --dev @celljs/style-guide
- `@celljs/style-guide/eslint/warnings`(警告级别的配置)
- `@celljs/style-guide/eslint/xxs`(跨站脚本攻击相关的配置)

> 您需要使用 `require.resolve` 为 ESLint 提供绝对路径,
> 由于围绕 ESLint 配置解析的问题(请参阅
> [eslint/eslint#9188](https://github.com/eslint/eslint/issues/9188)
例如,一个简单的项目复用 ESLint 配置,配置如下

```js
module.exports = [
...require.resolve('@celljs/style-guide/eslint')
...require('@celljs/style-guide/eslint')
];
```
当然,也可以更具情况选择具体级别的一个或多个配置。
```js
module.exports = [
...require.resolve('@celljs/style-guide/eslint/base'),
...require.resolve('@celljs/style-guide/eslint/errors')
...require('@celljs/style-guide/eslint/base'),
...require('@celljs/style-guide/eslint/errors')
];
```

如果是一个纯 javascript 项目,配置如下:

```js
module.exports = [
...require.resolve('@celljs/style-guide/eslint/javascript')
...require('@celljs/style-guide/eslint/javascript')
];
```

Expand Down

0 comments on commit 336dc14

Please sign in to comment.