Skip to content

Commit

Permalink
fix: text error defore img
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyFBB committed Feb 25, 2024
1 parent 2a33581 commit 9cd8b55
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ module.exports = {
#### 项目中引入插件

由于是本地开发,所以采用`npm link`的方式,使用我们创建的 plugins

![link](https://user-images.githubusercontent.com/38368040/169676050-bb1f0d7e-7d85-463d-bb6b-53232a517ce9.png)
在我们的项目中引入该插件 npm link eslint-plugin-demo,创建对应的软链接

![demo](https://user-images.githubusercontent.com/38368040/169676054-8220744a-b145-4279-ada5-1f6ffebe9459.png)

配置如下的 .eslintrc.js 文件,编写对应的代码,执行一下 eslint
Expand All @@ -263,6 +265,7 @@ module.exports = {
我们需要处理块级语句,也就是`BlockStatement`,对于该节点来说,希望它和判断条件在一行并且中间保持一个空格。

⚠️ 我们之所以在 Eslint 中可以做格式校验,是因为我们可以通过 context 提供的`getSourceCode`API 获得 AST 以及相关的 tokens

![sourceCode](https://user-images.githubusercontent.com/38368040/169676114-74a8eb9f-8424-4ac8-ae2e-0c4bdc5b6e8f.png)
![token](https://user-images.githubusercontent.com/38368040/169676121-32809119-21da-4318-a837-e8cffa0138be.png)

Expand Down

0 comments on commit 9cd8b55

Please sign in to comment.