DianaSuvorova / eslint-plugin-react-redux

Enforcing best practices for react-redux

Home Page:https://www.npmjs.com/package/eslint-plugin-react-redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new rule: mapDispatchToProps-consistent-dispatch

DianaSuvorova opened this issue · comments

mapDispatchToProps-consistent-dispatch
This rule would warn the following case:

const mapDispatchToProps = dispatch => ({
  onDoSomething: () => dispatch(toSomethingElse()),
  action1: action1
});

while below two are correct:

const mapDispatchToProps = dispatch => ({
  onDoSomething: () => dispatch(toSomethingElse()),
  action1: () => dispatch(action1())
});
const mapDispatchToProps = {
  onDoSomething: doSomethingElse
  action1,
});

as per discussion #10