Created
January 5, 2020 00:09
-
-
Save vinothpandian/fb8b72a9d6ea817f1e8317b1e8a156cb to your computer and use it in GitHub Desktop.
Add eslint airbnb guidelines to create-react-app
This file contains 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 characters
yarn add -D eslint-config-airbnb eslint-config-prettier prettier eslint-plugin-{jsx-a11y,prettier,react,react-hooks} | |
cat <<EOF >./.eslintrc | |
{ | |
"env": { | |
"browser": true | |
}, | |
"extends": [ | |
"react-app", | |
"airbnb", | |
"plugin:jsx-a11y/recommended", | |
"prettier", | |
"prettier/react" | |
], | |
"plugins": ["jsx-a11y", "react-hooks", "prettier"], | |
"rules": { | |
// Allow single Named-export | |
"import/prefer-default-export": "off", | |
// Set react-hooks lint as error | |
"react-hooks/rules-of-hooks": "error" | |
} | |
} | |
EOF | |
cat <<EOF >./.eslintignore | |
src/serviceWorker.js | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install directly run the following command inside the app folder created using create-react-app
curl https://gist.githubusercontent.com/vinothpandian/fb8b72a9d6ea817f1e8317b1e8a156cb/raw/6dbe3afd1c70bfec16ed002ca22ef7efad66f89a/add-react-airbnb-eslint.sh | bash