Skip to content

Conversation

@JakeSidSmith
Copy link
Contributor

@JakeSidSmith JakeSidSmith commented Sep 23, 2018

Note: readme updates will not be made until we're ready for a release. At this point I will document installation, configuration, and all rules.

Add rules to disallow prop unions and intersections within Component definitions e.g.

extends Component<Props & RouteProps>
extends PureComponent<{} | Props>

Reasoning: this better ensures that the external interface for a component matches the internal interface, or is modified by HOCs correctly.

Rules config:

{
  "rules": {
    "no-component-prop-intersection": true,
    "no-component-prop-union": true
  }
}

screen shot 2018-09-23 at 21 43 44

Copy link

@pmg103 pmg103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Can you put in the PR description the 'why' though as its not immediately obvious (to me at least) the rationale for these new rules

@AngryLawyer
Copy link

This looks great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants