correctness/noNestedComponentDefinitions
correctness · since 2.0.0
Disallows defining React components inside other components.
function ParentComponent() {
function ChildComponent() {
return <div>Hello</div>;
}
return <ChildComponent />;
}function ParentComponent() {
const MemoizedChild = memo(() => {
return <div>Hello</div>;
});
return <MemoizedChild />;
}function ChildComponent() {
return <div>Hello</div>;
}
function ParentComponent() {
return <ChildComponent />;
}Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
Disallow disabling zoom with user-scalable=no in the <meta name="viewport"> element.
Disallow Sass variables and function calls in custom property values without #{} interpolation.
Detect return type annotations that are misleadingly wider than what the implementation actually returns.
Disallow usage of element handles (page.$() and page.$$()).
ESLint does not have this rule.
Oxlint does not have this rule.
correctness/noNestedComponentDefinitions
correctness · since 2.0.0
{
"linter": {
"rules": {
"correctness": {
"noNestedComponentDefinitions": "error"
}
}
}
}