Forked from bradtraversy/eslint_prettier_airbnb.md
Created
September 15, 2020 07:10
-
-
Save dmitry-shibanov/77507d0ff9d6defe10906bb38d4cda23 to your computer and use it in GitHub Desktop.
Revisions
-
bradtraversy created this gist
Jul 19, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ # VSCode - ESLint, Prettier & Airbnb Setup ### 1. Install ESLint & Prettier extensions for VSCode Optional - Set format on save and any global prettier options ### 2. Install Packages ``` npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node ``` ``` npx install-peerdeps --dev eslint-config-airbnb ``` ### 3. Create .prettierrc for any prettier rules (semicolons, quotes, etc) ### 4. Create .eslintrc.json file (You can generate with eslint --init if you install eslint globally) ``` { "extends": ["airbnb", "prettier", "plugin:node/recommended"], "plugins": ["prettier"], "rules": { "prettier/prettier": "error", "no-unused-vars": "warn", "no-console": "off", "func-names": "off", "no-process-exit": "off", "object-shorthand": "off", "class-methods-use-this": "off" } } ``` ### Reference * ESLint Rules - https://eslint.org/docs/rules/ * Prettier Options - https://prettier.io/docs/en/options.html * Airbnb Style Guide - https://github.com/airbnb/javascript