2016-03-02 161 views

回答

12

您可以在VSCode設置json文件中添加擴展級配置。通過命令面板中打開此:

  • F1
  • 型 「用戶設置」
  • 回車

添加規則eslint.options喜歡這一點,因爲每eslint documentation

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

您可以通過命令面板打開「工作區設置」將其添加到工作區級配置中。這將在您的項目中創建一個./vscode/settings.json文件。

+0

這個例子不是很有效 - 我剛纔瞭解到'eslint.options'是[CLIEngine](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)而不是['.eslintrc'](http://eslint.org/docs/user-guide/formatters/index.html#eslintrc) –

+0

你的意思是擴展文檔中的鏈接不應該指向http:/ /eslint.org/docs/developer-guide/nodejs-api#cliengine? –

+0

請參閱Erich Gammas對此[vscode-eslint pull請求]的評論(https://github.com/Microsoft/vscode-eslint/pull/4)。 –