Skip to content

prefer-shorthand rule should handle differently-named props #39

@MitchLillie

Description

@MitchLillie

In #10 this example was put forward about triggering false positives for the prefer-object rule:

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

That seems to have been fixed, however I'm wondering if this instance should fail the prefer-shorthand rule. Because this could be refactored to:

const mapDispatchToProps = {
  onDoSomething: toSomethingElse
};

Any thoughts on this? Thanks for a great lib btw :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions