Skip to content

Instantly share code, notes, and snippets.

@mustafamagdy
Created January 29, 2019 09:28
Show Gist options
  • Select an option

  • Save mustafamagdy/53346144cf921c61fb60cbec3916bd94 to your computer and use it in GitHub Desktop.

Select an option

Save mustafamagdy/53346144cf921c61fb60cbec3916bd94 to your computer and use it in GitHub Desktop.
ESLint for react native
module.exports = {
parser: "babel-eslint",
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
extends: ["eslint:recommended", "plugin:react/recommended"],
parserOptions: {
ecmaFeatures: {
jsx: true,
modules: true,
experimentalObjectRestSpread: true
},
ecmaVersion: 6,
sourceType: "module"
},
plugins: ["react"],
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "windows"],
quotes: ["error", "double"],
semi: ["error", "always"],
"react/jsx-uses-react": 2,
"react/react-in-jsx-scope": 2,
"react/jsx-first-prop-new-line": [1, "multiline"],
"react/jsx-max-props-per-line": [1, { maximum: 1, when: "always" }],
"react/prop-types": [0, { ignore: "ignore", customValidators: "customValidator" }]
},
settings: {
react: {
pragma: "React",
version: "16.6.3"
}
}
};
@mustafamagdy
Copy link
Author

mustafamagdy commented Jan 29, 2019

You need to install these dev deps:
yarn add --dev babel-eslint eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react prettier-eslint-cli

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