Skip to content

Instantly share code, notes, and snippets.

@gjgd
Last active June 26, 2020 00:31
Show Gist options
  • Save gjgd/070cac8c24979e1cdff60bc116713c39 to your computer and use it in GitHub Desktop.
Save gjgd/070cac8c24979e1cdff60bc116713c39 to your computer and use it in GitHub Desktop.
Eslint

Eslint

npm i -D eslint eslint-config-airbnb eslint-plugin-import

.eslintrc.json

{
  "extends": "airbnb-base"
}

Prettier

npm i -D prettier

.prettierrc.json

{
  "printWidth": 80,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "es5"
}

Eslint + Prettier

Read https://prettier.io/docs/en/integrating-with-linters.html

npm i -D eslint-config-prettier eslint-plugin-prettier

.eslintrc.json (Note that "plugin:prettier/recommended" has to be the last item in the extends array)

{
  "extends": ["airbnb-base", "plugin:prettier/recommended"]
}  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment