Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Created July 1, 2022 06:52
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 harisrozak/f9c3cda163f12522f3a6936564956351 to your computer and use it in GitHub Desktop.
Save harisrozak/f9c3cda163f12522f3a6936564956351 to your computer and use it in GitHub Desktop.
Integrating Prettier + ESLint + Airbnb Style Guide In VSCode

Integrating Prettier + ESLint + Airbnb Style Guide In VSCode

#1 Download the ESLint and Prettier extensions for VSCode.

#2 Install the ESLint and Prettier libraries into our project.

npm install -D eslint prettier

#3 Install the Airbnb config.

npx install-peerdeps --dev eslint-config-airbnb

#4 Install eslint-config-prettier and eslint-plugin-prettier

npm install --save-dev eslint-config-prettier
npm install --save-dev eslint-plugin-prettier
npm install --save-dev --save-exact prettier

#5 Create .eslintrc file in your project’s root directory

{
  "extends": ["airbnb", "prettier"],
  "plugins": ["prettier"],
  "rules": {
    "prettier/prettier": ["error"]
  },
}

#6 Create .prettierrc file in your project’s root directory

{
  "printWidth": 100,
  "singleQuote": true
}

#7 Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment