Browse Source

Fix: React lifecycle methods shouldn't fail eslint

v5.0.0-beta
Eli Perelman 8 years ago
parent
commit
0846765afc
  1. 17
      packages/neutrino-preset-react/src/index.js

17
packages/neutrino-preset-react/src/index.js

@ -30,7 +30,22 @@ module.exports = neutrino => {
},
rules: {
'react/prop-types': ['off'],
'jsx-quotes': ['error', 'prefer-double']
'jsx-quotes': ['error', 'prefer-double'],
'class-methods-use-this': ['error', {
exceptMethods: [
'render',
'getInitialState',
'getDefaultProps',
'getChildContext',
'componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'componentDidUpdate',
'componentWillUnmount'
]
}]
}
})
};

Loading…
Cancel
Save