no-inline-properties-type
WarningDeclare component properties as a named type. Do not write an object type literal in the parameter.
function TextLink(properties: { href: string; children: JSX.Element }) { return <a href={properties.href}>{properties.children}</a>;}export function SeverityLabel(properties: { severity: Severity }) { return <span>{properties.severity}</span>;}export default function Page(properties?: { title: string }) { return <h1>{properties?.title}</h1>;}export const Card = ({ title }: { title: string }) => <div>{title}</div>;const Card = function (properties: { title: string }) { return <div>{properties.title}</div>;};const Card = memo(function Card(properties: { title: string }) { return <div>{properties.title}</div>;});export function Link(properties: HTMLArkProps<"a"> & { external: boolean }) { return <a {...properties} />;}function Base(properties: PropsWithChildren<{ preview: string }>) { return <main title={properties.preview}>{properties.children}</main>;}function List<T>(properties: { items: T[] }) { return <ul>{properties.items.map(String)}</ul>;}type TextLinkProperties = { href: string; children: JSX.Element;};export function TextLink(properties: TextLinkProperties) { return <a href={properties.href}>{properties.children}</a>;}export function Button({ children, ...rest }: ButtonProperties) { return <button {...rest}>{children}</button>;}function Base({ children, preview }: PropsWithChildren<BaseProperties>) { return <main title={preview}>{children}</main>;}function List<T>(properties: ListProperties<T>) { return <ul>{properties.items.map(properties.render)}</ul>;}function renderRow(row: { id: string }) { return <li>{row.id}</li>;}function List(properties: ListProperties) { const renderItem = (item: { id: string }) => <li>{item.id}</li>; return <ul>{properties.items.map(renderItem)}</ul>;}export function Controller(options: { path: string }): ClassDecorator { return (target) => register(target, options.path);}export function Field(properties: { multiple: true }): JSX.Element;export function Field(properties: { multiple: false }): JSX.Element;export function Field(properties: FieldProperties) { return <input multiple={properties.multiple} />;}How to fix
Declare the object type with type next to the component and annotate the parameter with it: type TextLinkProperties = { href: string } and function TextLink(properties: TextLinkProperties). The rule does not check the alias name.
This applies to destructured parameters and to object literals inside intersections, unions and type arguments, as in Base & { extra: string }; move the whole type into the alias. Generic components declare a generic alias, as in type ListProperties<T> = { items: T[] }.
The rule checks functions with an upper-case name that contain JSX. It skips overload signatures and arrow functions passed to a call, such as memo((properties) => ...).