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

vscode的eslint运行错误,请帮忙看看怎么解决 ('plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead) #4

Closed
zjl-coder opened this issue Jan 23, 2022 · 2 comments
Labels

Comments

@zjl-coder
Copy link
Collaborator

eslint报错信息:

Error: Invalid Options:
- 'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead
    at processOptions (/Users/abc/Desktop/kinron/opt/github/tdesign-mobile-react/node_modules/eslint/lib/eslint/eslint.js:294:15)
    at new ESLint (/Users/abc/Desktop/kinron/opt/github/tdesign-mobile-react/node_modules/eslint/lib/eslint/eslint.js:441:34)
    at Object.e.newESLintClass (/Users/abc/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:167243)
    at Ce (/Users/abc/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:186299)
    at /Users/abc/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:180305
    at /Users/abc/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js:1:181582

问题产生的操作过程

# 下载项目
git clone git@github.com:TDesignOteam/tdesign-mobile-react.git

# 安装 submodule
git submodule init
git submodule update

## 安装 package
npm i
cd docs && npm i && cd ..
cd src/_common && npm i && cd ../../

然后vscode的eslint插件就一直报一个错误

image

该错误当前的定位

node_modules/eslint/lib/eslint/eslint.js 270行 出现报错信息,plugins 不能为数组,否则会抱这个错误。
image

当前 plugins 打印出来的值是 [ 'html' ],是一个数组值,但是不知道这个值是从哪个传进来的。
image

如果将plugins在源码里面强制重新复制为 空对象,则 eslint 运行正常
image

影响这个结果的可能的文件是 src/_common/test/script/jest.unit.config.js. 20行
image

@github-actions
Copy link
Contributor

这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。

@github-actions github-actions bot added the Stale label Mar 16, 2022
@github-actions
Copy link
Contributor

此 Issue 被自动关闭,因为它自被标记为过时 stale 以来已闲置 7 天。

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

No branches or pull requests

1 participant