首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ESLint不承认"@typescript-eslint/eslint-plugin“

ESLint不承认"@typescript-eslint/eslint-plugin“
EN

Stack Overflow用户
提问于 2019-12-11 13:50:17
回答 1查看 6.2K关注 0票数 12

我一直试图让ESLint在VS代码中进行一个新的角度项目,但是它没有加载“@typescript eslint/eslint”。在过去的三个小时里,我一直试图找出问题的所在,并到处寻找解决方案。

代码语言:javascript
运行
复制
Failed to load plugin '@typescript-eslint' declared in 'png-ui/.eslintrc.js': Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- /Users/Yahia/Desktop/Plugngrow-UI/__placeholder__.js
Referenced from: /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js
Happened while validating /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js
This can happen for a couple of reasons:
1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
2. If ESLint is installed globally, then make sure '@typescript-eslint/eslint-plugin' is installed globally as well.
3. If ESLint is installed locally, then '@typescript-eslint/eslint-plugin' isn't installed correctly.

Consider running eslint --debug /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js from a terminal to obtain a trace about the configuration files used.

调试到目前为止所采取的步骤:

  • 我卸载了全局版本以及扩展,然后重新安装了扩展,并在项目文件夹中本地安装了ESLint。
  • 我正在使用一个新安装的角应用程序,该应用程序是使用角ng new命令创建的。
  • 我运行了eslint --debug /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js命令。它只会导致在调试过程中忽略".eslintrc.js“文件的警告。

请注意,在另一个项目中,ESLint工作得很好,我在做介绍性教程时从角度文档下载了这个项目。

如果这有助于检查,我已经为项目创建了一个Github回购

请原谅我在编程和相关工具方面的新鲜感。

EN

回答 1

Stack Overflow用户

发布于 2021-02-18 22:09:20

我昨天刚遇到这个问题。我建议您在本地重新安装“@typescript eslint/eslint”,并查看该帮助。您还可以对eslintrc.js文件进行新的设置,并且应该很容易修复。

这个链接很有帮助。https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59287268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档