enforce
FC
andFunctionComponent
types to one or the other
- ⭐️ This rule is included in
plugin:@typehut/recommended
preset.- ✒️ The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
By enforcing or not suppressing the React component type, a sense of unity is created.
You can also enforce React.FunctionComponent
if "Do not omit" is recommended as a style guide for naming.
This rule enforces the React component type to either React.FC
or React.FunctionComponent
.
(Similarly, enforce rules on VFC
and VoidFunctionComponent
.)
This rule has either a string option:
"omit"
(default) enforces consistent use ofReact.FC
andReact.VFC
"raw"
enforces consistent use ofReact.FunctionComponent
andReact.VoidFunctionComponent