🚫 This rule is disabled in the 🏃 jsx-runtime
config.
💼 This rule is enabled in the following configs: all
. This rule is disabled in the following configs: jsx-runtime
.
Note:
This rule is not part of recommended set, because babel-plugin-inferno
can handle inferno import declaration automatically.
Import inferno only if your code needs it.
When using JSX, <a />
expands to Inferno.createElement("a")
. Therefore, the Inferno
variable must be in scope.
If you are using the @jsx pragma this rule will check the designated variable and not the Inferno
one.
Examples of incorrect code for this rule:
var Hello = <div>Hello {this.props.name}</div>;
/** @jsx Foo.bar */
var Inferno = require('inferno');
var Hello = <div>Hello {this.props.name}</div>;
Examples of correct code for this rule:
import Inferno from 'inferno';
var Hello = <div>Hello {this.props.name}</div>;
var Inferno = require('inferno');
var Hello = <div>Hello {this.props.name}</div>;
/** @jsx Foo.bar */
var Foo = require('foo');
var Hello = <div>Hello {this.props.name}</div>;
If you are setting Inferno
as a global variable you can disable this rule.