如何在vscode中配置eslint扩展? [英] How to configure the eslint extension in vscode?

查看:107
本文介绍了如何在vscode中配置eslint扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

vscode eslint扩展说:

配置选项

  • eslint.enable :启用/禁用eslint.默认情况下启用.
  • eslint.options :此处是ESLint API定义的选项袋.默认为空选项袋.

Configuration Options

  • eslint.enable: enable/diable eslint. Is enabled by default.
  • eslint.options: an option bag as defined by the ESLint API here. Defaults to an empty option bag.

我不知道在哪里配置eslint扩展名?在命令中搜索 configure 不会产生任何结果.

I cannot figure out where to configure the eslint extension? Searching configure in the commands results in nothing.

推荐答案

您可以在VSCode settings.json 文件中添加扩展级别的配置.通过命令面板打开它:

You can add extension-level configuration in the VSCode settings.json file. Open this through the command palette:

  • F1
  • 输入用户设置"
  • Enter

根据 ESLint文档:

// Place your settings in this file to overwrite the default settings
{
    "eslint.options": {
        "rules": {
            "quotes": [2, "double"]
        }
    }
}


您可以通过命令面板打开工作区设置",将其添加到工作区级配置中.这将在您的项目中创建一个 ./vscode/settings.json 文件.

这篇关于如何在vscode中配置eslint扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆