Setting up ESLint on VS Code with Airbnb JavaScript Style Guide

  1. cd coding-directory
  2. npm init -y
  3. npm install --save-dev --save-exact eslint eslint-config-airbnb-base eslint-plugin-import
  4. Create .eslintrc.js file with following content:
      “extends”: “airbnb-base”,
      “env”: {
      “browser”: true,
      “node”: true
  1. Install ESLint plugin (extension) in Visual Studio Code (shift + command + x / VScode -> View -> Extension)
  2. Restart Visual Studio Code

To check result

if you get error like

ESLint Parsing error: Unexpected token

Solved it by installing babel-eslint using npm

npm install babel-eslint --save-dev

Secondly, add this configuration in .eslintrc file


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s