no-manual-children-property
errorType-aware
Disallow manually declaring children in React component props when a configured wrapper type should provide it.
Rule details Type-aware
Section titled “Rule details Type-aware ”This rule enforces a wrapper-based children model for React component props. By default it expects
PropertiesWithChildren and reports both:
- manual
childrendeclarations such aschildren?: ReactNode - other wrapper styles such as
PropsWithChildrenunless 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.
Examples
Section titled “Examples”Incorrect
Manual children declaration
Section titled “Manual children declaration”import type { ReactNode } from "react";
interface FrameProperties { readonly position: UDim2; readonly zIndex?: number; readonly children?: ReactNode;}Correct
Wrapper-owned children
Section titled “Wrapper-owned children”import type { PropertiesWithChildren } from "react";
interface FrameProperties extends PropertiesWithChildren { readonly position: UDim2; readonly zIndex?: number;}Options
Section titled “Options”| 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"], }, ], }, },];Related rules
Section titled “Related rules”ban-react-fcMoves component typing away from React.FC and toward direct prop signatures
prefer-read-only-propsKeeps component props immutable once their shape is established
