简体   繁体   中英

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. 16.5.4 there are warnings displayed for typescript files with import and export declarations.

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

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

Warnings are not shown if files are not opened. But when I open a typescript file, then warning apears.

It is a starter template of angular 9. I added to it a few packages (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 . 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.

If you want to disable ESLint entirely for that project in VS:

  1. Navigate to Tools > Options
  2. Select Text Editor on left pane
  3. Expand JavaScript/TypeScript
  4. Select Linting > General
  5. Uncheck Enable ESLint
  1. Navigate to Tools > Options
  2. Select Text Editor on left pane
  3. Expand JavaScript/TypeScript
  4. Select Linting > General
  5. Click Reset Global.eslintrc button
  6. click OK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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