no-useless-constructor
as warning/error// filename: test.jsx
import * as React from 'react';
export class TestComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div></div>
);
}
}
7:5 error Useless constructor no-useless-constructor
TestComponent
's constructor must be called, so it should not be the error.@saneyuki Thanks for the issue! If you're reporting a bug, please be sure to include:
eslint -v
)Requesting a new rule? Please see Proposing a New Rule for instructions.
JavaScript will provide a default constructor that will call super by default. So you don't need constructor in this case. I think this is correct behavior.
Yep, looks like the rule is working fine.
Most helpful comment
JavaScript will provide a default constructor that will call super by default. So you don't need constructor in this case. I think this is correct behavior.