visual-studio-code - 在 Visual Studio Code 中找不到自动修复保存按钮

标签 visual-studio-code eslint

我正在按照教程打开保存文件时的 ESLint 自动修复。教程演示了如何选中复选框。我找不到它。我需要任何扩展或 smth 吗?

转到:查看 -> 命令面板 -> 首选项:打开工作区设置 -> 扩展 -> ESLint

这是教程中设置页面的样子:

How settings page should look

这就是我所看到的:

This is what I see

最佳答案

该设置已弃用。 Auto Fix on Save 现在是 VS Code 的 Code Action on Save 基础设施的一部分。见 release notes .只是为了好玩,您可以通过添加 "eslint.autoFixOnSave": true 来恢复复选框。到您的 settings.json。但是,您现在需要添加的是:

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }

关于visual-studio-code - 在 Visual Studio Code 中找不到自动修复保存按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59481194/

相关文章:

visual-studio-code - VSCode 1.3.1 : Editors do not open in new tab

visual-studio-code - 在vscode Remote 中禁用自动终端

node.js - 为什么 "npm run lint"指向父文件夹中的 .eslintrc 不是当前文件夹?

javascript - babel-eslint 不允许动态导入

javascript - 如何为以下代码行修复 Es-lint "no-return-assign"

node.js - Babel 模块解析器无法按预期工作( Node + typescript )

c++ - 错误: During startup program exited with code 0xc0000135

amazon-web-services - 设置 AWS 凭证以使用 MFA 并能够通过 VScode 中的 AWS Toolkit 担任指定配置文件的角色的正确方法是什么?

python - 在抽象类中使用children方法可以吗? pep8 说实例没有成员

javascript - 变量被分配了一个值,但在 Vue 数据对象中声明它并在方法中使用它时从未使用过