Last active
October 30, 2021 11:55
-
-
Save radiovisual/7c27e5a1d0f7aa56e0e3922c98e19ffc to your computer and use it in GitHub Desktop.
React Native AirBnB ESLint Config
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 characters
{ | |
"parser": "babel-eslint", | |
"plugins": [ | |
"react", | |
"react-native" | |
], | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true, | |
"modules": true | |
} | |
}, | |
"extends" : [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
"airbnb-base" | |
], | |
"rules" : { | |
"arrow-body-style" : 'warn' | |
} | |
} |
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 characters
npm install --save-dev babel-eslint eslint-config-airbnb-base eslint-plugin-react eslint-plugin-react-native |
Thanks.
Awesome.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You also need to install
eslint-plugin-import
andeslint
. I asume you forgot them because you have them installed globally, wich is a bat practice, so:npm i eslint-plugin-import eslint --save-dev
.Then can run
npx eslint .
or add this scripts to yourpackage.json
:And then run
npm run estlint
ornpm run eslint-fix
if you want to autofix your code.Also is cool to have a
pre-commit
hook witheslint
, maybe usingpre-git
npm package and adding this to thepackage.json
: