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)。 –