jsx-eslint/eslint-plugin-react

Rule proposal: check constructor params for props and context

Open

#626 opened on Jun 7, 2016

 (7 comments) (5 reactions) (0 assignees)JavaScript (2,734 forks)batch import
help wantednew rule

Repository metrics

Stars
 (9,293 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

This rule would check for:

class X extends Component {
  constructor(props, context) {
    super(props, context);
  }
}

React is lenient, so constructor() { super(); } works, so this is just a stylistic preference.

Contributor guide