简体   繁体   English

Visual Studio 警告:(ESLint)无法加载配置“defaults/configurations/eslint”以扩展。 引用自 C:\Users\{用户名}\.eslintrc

[英]visual studio warning: (ESLint) Failed to load config "defaults/configurations/eslint" to extend from. Referenced from C:\Users\{username}\.eslintrc

In Visual Studio 2019 Community ver.在 Visual Studio 2019 社区版中。 16.5.4 there are warnings displayed for typescript files with import and export declarations. 16.5.4 对带有进出口声明的 typescript 文件显示警告。

“错误列表”选项卡,警告

打字稿文件的编辑器窗口中的注释:

Warnings are not shown if files are not opened.如果未打开文件,则不会显示警告。 But when I open a typescript file, then warning apears.但是当我打开 typescript 文件时,会出现警告。

It is a starter template of angular 9. I added to it a few packages (bootstrap, jwt-decode, fontawesome, jquery, popper.js)它是 angular 9 的入门模板。我添加了几个包(bootstrap、jwt-decode、fontawesome、jquery、popper.js)

Visual Studio's ESLinter is attempting to load a global config file that is referenced in C:\Users\Adam - go there and look for a file named .eslintrc . Visual Studio 的 ESLinter 正在尝试加载C:\Users\Adam - go 中引用的全局配置文件并查找名为.eslintrc的文件。 You may remove it.你可以删除它。

After you remove it I believe VS will use it's default ESLint config and you may see warnings that apply to Typescript but don't really make sense in the context of Angular.删除它后,我相信 VS 会使用它的默认 ESLint 配置,您可能会看到适用于 Typescript 但在 Angular 的上下文中没有意义的警告。

If you want to disable ESLint entirely for that project in VS:如果你想在 VS 中完全禁用该项目的 ESLint:

  1. Navigate to Tools > Options导航到工具>选项
  2. Select Text Editor on left pane左窗格上的 Select文本编辑器
  3. Expand JavaScript/TypeScript展开JavaScript/TypeScript
  4. Select Linting > General Select起绒 >一般
  5. Uncheck Enable ESLint取消选中启用 ESLint
  1. Navigate to Tools > Options导航到工具 > 选项
  2. Select Text Editor on left pane左窗格上的 Select 文本编辑器
  3. Expand JavaScript/TypeScript展开 JavaScript/TypeScript
  4. Select Linting > General Select 起绒 > 一般
  5. Click Reset Global.eslintrc button单击重置 Global.eslintrc 按钮
  6. click OK点击确定

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM