Component prop typedef does not exceed max properties.
Component prop typedef with a large number of properties usually is an indicator that the component is too complex, or that the component API surface needs some tidying.
Examples of incorrect code for this rule:
// typedef with >7 properties
type MyComponentProps = {
firstName: string,
lastName: string,
designation: string,
dayDateOfBirth: number,
monthDateOfBirth: number,
yearDateOfBirth: number,
countryName: string,
countryCode: string,
};
Examples of correct code for this rule:
// grouping of related props into nested properties
type MyComponentProps = {
name: UserName,
dateOfBirth: UserDateOfBirth,
country: UserCountry,
};
type UserName = {
firstName: string,
lastName: string,
designation: string,
};
type UserDateOfBirth = {
dayDateOfBirth: number,
monthDateOfBirth: number,
yearDateOfBirth: number,
};
type UserCountry = {
name: string,
code: string,
};
maxProps
:number
, default:7