Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 688 Bytes

no-unused-class-component-methods.md

File metadata and controls

36 lines (29 loc) · 688 Bytes

Disallow declaring unused methods of component class (inferno/no-unused-class-component-methods)

Warns you if you have defined a method or property but it is never being used anywhere.

Rule Details

The following patterns are considered warnings:

class Foo extends Inferno.Component {
  handleClick() {}
  render() {
    return null;
  }
}

The following patterns are not considered warnings:

class Foo extends Inferno.Component {
  static getDerivedStateFromError(error) {
    return { hasError: true };
  }
  action() {}
  componentDidMount() {
    this.action();
  }
  render() {
    return null;
  }
}
});