Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure the eslint extension in vscode?

Tags:

The vscode eslint extension says:

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.

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

like image 810
Michael_Scharf Avatar asked Mar 02 '16 02:03

Michael_Scharf


People also ask

How do I configure ESLint?

There are two primary ways to configure ESLint: Configuration Comments - use JavaScript comments to embed configuration information directly into a file. Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.


1 Answers

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

  • Press F1
  • Type "user settings"
  • Press Enter

Add the rules in eslint.options like this, according to the ESLint documentation:

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

You can add this to workspace-level configuration by opening "workspace settings" through the command palette. This will create a ./vscode/settings.json file in your project.

like image 61
Daniel Imms Avatar answered Sep 20 '22 19:09

Daniel Imms