Skip to content

Instantly share code, notes, and snippets.

@gupta-ji6

gupta-ji6/.eslintrc.json

Last active Apr 20, 2021
Embed
What would you like to do?
ESLint Setup for React Native Projects
{
"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"
}
}
@gupta-ji6

This comment has been minimized.

Copy link
Owner Author

@gupta-ji6 gupta-ji6 commented Aug 13, 2020

devDependencies required are:

  1. babel-eslint
  2. eslint-config-airbnb
  3. eslint-plugin-import
  4. eslint-plugin-jsx-a11y
  5. eslint-plugin-react
  6. eslint-plugin-react-hooks
  7. eslint-plugin-react-native

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment