Skip to content

no-manual-children-property

errorType-aware

Disallow manually declaring children in React component props when a configured wrapper type should provide it.

This rule enforces a wrapper-based children model for React component props. By default it expects PropertiesWithChildren and reports both:

  • manual children declarations such as children?: ReactNode
  • other wrapper styles such as PropsWithChildren unless you explicitly allow them

mode: "auto" uses type-aware resolution when project type information is available, then falls back to syntax-only inspection when it is not.

Incorrect
import type { ReactNode } from "react";
interface FrameProperties {
readonly position: UDim2;
readonly zIndex?: number;
readonly children?: ReactNode;
}
Correct
import type { PropertiesWithChildren } from "react";
interface FrameProperties extends PropertiesWithChildren {
readonly position: UDim2;
readonly zIndex?: number;
}
Option Type Default Notes
mode "auto" | "fast" | "accurate" "auto" Chooses syntax-only, type-aware, or automatic behavior.
wrapperNames string[] ["PropertiesWithChildren"] Accepted wrapper names that are allowed to provide children.
import ceaseNonsense from "@pobammer-ts/eslint-cease-nonsense-rules";
export default [
{
plugins: {
"cease-nonsense": ceaseNonsense,
},
rules: {
"cease-nonsense/no-manual-children-property": [
"error",
{
mode: "auto",
wrapperNames: ["PropertiesWithChildren", "AppChildrenProps"],
},
],
},
},
];