Skip to content

Instantly share code, notes, and snippets.

@cheung31
Created August 11, 2017 19:03
Show Gist options
  • Save cheung31/3b10ab25fd108c0b4988cba6f87a7cd2 to your computer and use it in GitHub Desktop.
Save cheung31/3b10ab25fd108c0b4988cba6f87a7cd2 to your computer and use it in GitHub Desktop.
Sane/Strict .eslintrc for React applications
{
"extends": "airbnb",
"env": {
"browser": true,
"amd": true,
"commonjs": true,
"jest": true,
"mocha": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": ["error", 4],
"array-callback-return": "warn",
"consistent-return": "off",
"max-len": "warn",
"no-console": "off",
"no-param-reassign": "warn",
"no-plusplus": "off",
"no-process-env": "off",
"no-shadow": "warn",
"no-use-before-define": "warn",
"react/forbid-prop-types": "warn",
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"react/jsx-filename-extension": ["error", { "extensions": [".jsx", ".js"] }],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment