Skip to content

Instantly share code, notes, and snippets.

@zeusbaba
Last active October 13, 2017 07:55
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 zeusbaba/cc169d9fd73b3315908e2758ed9edf9d to your computer and use it in GitHub Desktop.
Save zeusbaba/cc169d9fd73b3315908e2758ed9edf9d to your computer and use it in GitHub Desktop.
ESLINT via the easiest way
/*
// adapted from https://medium.com/@netczuk/your-last-eslint-config-9e35bace2f99
How to enable ESLINT via the easiest way?
1) prepare this file .eslintrc.js
2) remember to update .gitignore like this;
# Ignore all dotfiles...
.*
# except for
!.gitignore
!.editorconfig
!.eslintrc.json
!.eslintrc.js
!.npmignore
3) also add required packages as peer/dev dependencies
yarn add eslint-config-last eslint-plugin-react -D -E
yarn add eslint babel-eslint prettier eslint-plugin-prettier eslint-config-prettier -D -E
4) now we are ready!
run this;
yarn eslint --ext .jsx --fix .
then fix your code based the errors you see
additionally; when you need you can also disable rules with inline comments, see;
https://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments
*/
module.exports = {
extends: ['last', 'prettier/react', 'plugin:react/recommended'],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment