Skip to content

Instantly share code, notes, and snippets.

@Pholisa-Fatyela
Forked from Unalo/Eslint.md
Created June 10, 2021 11:26
Show Gist options
  • Save Pholisa-Fatyela/745a7b333d7463b0a5c5251ba49dcab2 to your computer and use it in GitHub Desktop.
Save Pholisa-Fatyela/745a7b333d7463b0a5c5251ba49dcab2 to your computer and use it in GitHub Desktop.

Eslint For VsCode

ESLint is a tool for “linting” your code. It can analyze your code and warn you of potential errors. In order for it to work, you need to configure it with specific rules. Luckily, Standard provides an ESLint configuration that anyone can use.

  1. First we need to install Node.js
  2. Inside your current project. Initialize npm configuration npm init -y
  3. Now enable support for linting common JavaScript features. Past this in your terminal
    • npm i -D eslint eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard
  4. Now create .eslintrc.js with the following contents
    "extends": "standard"
    };
    
  5. Open VsCode and press Ctrl + Shift + X
  6. Type ESLint in the search bar
  7. Find ESLint in the results, then click the Install
  8. Go ahead and close VSCode and then re-open it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment