2016-03-02 11 views
12

vscode eslint extensionは言う:vscodeでeslint拡張を設定する方法は?

設定オプション
  • eslint.enable

:/ディアブルeslintを有効にします。デフォルトで有効になっています。
  • eslint.options:ここではESLint APIで定義されているオプションバッグです。デフォルトでは、空のオプションバッグになります。
  • どこでeslint拡張機能を設定するのか分かりませんか?コマンドでconfigureを検索すると、何も表示されません。

    答えて

    12

    拡張レベルの設定は、VSCode設定のjsonファイルに追加できます。

    eslint documentationを通り、このようなeslint.optionsにルールを追加入力します

    • 押しF1
    • タイプ "ユーザー設定"
    • プレス:コマンドパレットを介してこれを開きます。 :

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

      これを作業領域レベルの構成に追加するには、コマンドパレットで「作業領域の設定」を開きます。これにより、プロジェクトに./vscode/settings.jsonファイルが作成されます。

    +0

    hmmこの例はあまり有効ではありません - 私は '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

    この[vscode-eslint pull request](https://github.com/Microsoft/vscode-eslint/pull/4)に関するErich Gammasのコメントを参照してください。 –

    関連する問題