Last active
April 20, 2021 14:46
-
-
Save gupta-ji6/f767eb7119d9432bff27cc60e17c314d to your computer and use it in GitHub Desktop.
ESLint Setup for React Native Projects
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
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true, | |
"react-native/react-native": true | |
}, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
"plugin:react-hooks/recommended", | |
"plugin:jsx-a11y/recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings", | |
"airbnb", | |
"airbnb/hooks" | |
], | |
"globals": { | |
"Atomics": "readonly", | |
"SharedArrayBuffer": "readonly" | |
}, | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
}, | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"plugins": ["react", "react-native", "jsx-a11y"], | |
"rules": { | |
"quotes": 1, | |
"no-use-before-define": 0, | |
"react/jsx-filename-extension": [ | |
2, | |
{ | |
"extensions": [".js", ".jsx"] | |
} | |
], | |
"react/prop-types": 0, | |
"react-native/no-unused-styles": 2, | |
"react-native/split-platform-components": 2, | |
"react-native/no-inline-styles": 1, | |
"react-native/no-color-literals": 0, | |
"react-native/no-raw-text": 2, | |
"react-native/no-single-element-style-arrays": 2, | |
"comma-dangle": "off" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
devDependencies required are:
Command to install them all:
npm i -D babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-native
OR
yarn add --dev babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-native