12
的vscode eslint extension说:如何在vscode中配置eslint扩展?
配置选项
eslint.enable
:启用/魔鬼eslint。默认情况下启用。eslint.options
:此处由ESLint API定义的选项包。默认为空选项包。
我想不通的地方配置eslint扩展?在命令中搜索configure
不会导致任何结果。
的vscode eslint extension说:如何在vscode中配置eslint扩展?
配置选项
eslint.enable
:启用/魔鬼eslint。默认情况下启用。eslint.options
:此处由ESLint API定义的选项包。默认为空选项包。
我想不通的地方配置eslint扩展?在命令中搜索configure
不会导致任何结果。
您可以在VSCode设置json文件中添加扩展级配置。通过命令面板中打开此:
添加规则eslint.options
喜欢这一点,因为每eslint documentation :
// Place your settings in this file to overwrite the default settings
{
"eslint.options": {
"rules": {
"quotes": [2, "double"]
}
}
}
您可以通过命令面板打开“工作区设置”将其添加到工作区级配置中。这将在您的项目中创建一个./vscode/settings.json文件。
这个例子不是很有效 - 我刚才了解到'eslint.options'是[CLIEngine](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)而不是['.eslintrc'](http://eslint.org/docs/user-guide/formatters/index.html#eslintrc) –
你的意思是扩展文档中的链接不应该指向http:/ /eslint.org/docs/developer-guide/nodejs-api#cliengine? –
请参阅Erich Gammas对此[vscode-eslint pull请求]的评论(https://github.com/Microsoft/vscode-eslint/pull/4)。 –