Skip to content

Instantly share code, notes, and snippets.

@luispinto23
Last active April 29, 2022 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luispinto23/f8ea9591700b8f475251a18af4626973 to your computer and use it in GitHub Desktop.
Save luispinto23/f8ea9591700b8f475251a18af4626973 to your computer and use it in GitHub Desktop.
ESLint config

VS Code

Install the ESLint extension.

Configure ESLint as the default formatter

Enter the command pallete Ctrl+Shift+P

  • type: Preferences: Open User Settings image

    • Open the JSON config file: image

    • Change the following settings to enable ESLint and format on save:

      {
        "eslint.enable": true,
        "eslint.format.enable": true,
        "eslint.validate": [
          "javascript"
        ],
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "dbaeumer.vscode-eslint",
        "editor.codeActionsOnSave": {
          "source.fixAll.eslint": true
        },
      }
    • Optional changes to user settings:
      {
        "eslint.alwaysShowStatus": true,
        "editor.formatOnPaste": true,
      }

WebStorm/Idea platform IDEs

  • Go to File > Settings (Ctrl+Alt+S)
  • Then navigate to Languages & Frameworks > JavaScript > Code Quality Tools > ESLint
  • Check the option Automatic ESLint configuration
  • Check the opion Run eslint --fix on save image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment