Skip to content

Commit

Permalink
feat: Relax react rules
Browse files Browse the repository at this point in the history
- class-methods-use-this to warn and with react exceptions (#12)
- prefer-stateless-function to warn because it should be a hint
- react-in-jsx-scope to off because the React variable can be injected with webpack
  • Loading branch information
jhnns committed Jun 23, 2017
1 parent a2fd3f7 commit a026414
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ module.exports = {
],
rules: {
/* eslint-enable sort-keys */
// Allow certain react methods to have no this
// See https://github.com/peerigon/eslint-config-peerigon/issues/12
"class-methods-use-this": ["warn", {
"exceptMethods": [
"render",
"getInitialState",
"getDefaultProps",
"getChildContext",
"shouldComponentUpdate",
],
}],
"no-nested-ternary": "off", // nested ternaries can increase the readability of JSX components
"react/display-name": "error",
"react/forbid-component-props": "off",
Expand Down Expand Up @@ -67,9 +78,9 @@ module.exports = {
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/prefer-es6-class": "error",
"react/prefer-stateless-function": "error",
"react/prefer-stateless-function": "warn",
"react/prop-types": "error",
"react/react-in-jsx-scope": "error",
"react/react-in-jsx-scope": "off",
"react/require-render-return": "error",
"react/self-closing-comp": "error",
"react/sort-comp": "off",
Expand Down

0 comments on commit a026414

Please sign in to comment.