Examples of incorrect code for this rule:
class YourComponent extends Inferno.Component {
}
createClass({
});
Examples of correct code for this rule:
class YourComponent extends Inferno.Component {
shouldComponentUpdate () {
return false;
}
}
createClass({
shouldComponentUpdate: function () {
return false;
}
});
createClass({
mixins: [PureRenderMixin]
});
@infernoMixin.decorate(PureRenderMixin)
createClass({
});
...
"inferno/require-optimization": [<enabled>, { allowDecorators: [<allowDecorator>] }]
...
enabled
: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.allowDecorators
: optional array of decorators names to allow validation.
Sets the allowed names of decorators. If the variable is present in the chain of decorators, it validates
Examples of correct code for this rule:
// ['pureRender']
@pureRender
class Hello extends Inferno.Component {}
...
"inferno/require-optimization": [2, {allowDecorators: ['customDecorators']}]
...