Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
// $ExpectType Requireable
AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.elementType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType('div');
// $ExpectType Requireable
AirbnbPropTypes.elementType('*');
// $ExpectError
AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.explicitNull();
// $ExpectType Validator
AirbnbPropTypes.explicitNull().isRequired;
interface ForbidShape {
foo: string;
bar: number;
baz?: boolean | null;
}
// $ExpectType ValidationMap<{ foo: string | null | undefined; bar: number; baz: boolean | null | undefined; }>
AirbnbPropTypes.forbidExtraProps({
foo: PropTypes.string,
bar: PropTypes.number.isRequired,
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 });
// $ExpectType Requireable
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 });
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
// $ExpectType Requireable
AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.elementType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType('div');
// $ExpectType Requireable
AirbnbPropTypes.elementType('*');
// $ExpectError
AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.explicitNull();
// $ExpectType Validator
AirbnbPropTypes.explicitNull().isRequired;
interface ForbidShape {
foo: string;
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
// $ExpectType Requireable
AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.elementType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType('div');
// $ExpectType Requireable
AirbnbPropTypes.elementType('*');
// $ExpectError
AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.explicitNull();
// $ExpectType Validator
AirbnbPropTypes.explicitNull().isRequired;
interface ForbidShape {
foo: string;
bar: number;
baz?: boolean | null;
}
AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 });
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo');
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
// $ExpectType Requireable
AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.elementType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType('div');
// $ExpectType Requireable
AirbnbPropTypes.elementType('*');
// $ExpectError
AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.explicitNull();
// $ExpectType Validator
AirbnbPropTypes.explicitNull().isRequired;
interface ForbidShape {
foo: string;
bar: number;
baz?: boolean | null;
// $ExpectType Requireable
AirbnbPropTypes.componentWithName(/Foo/);
// $ExpectType Requireable
AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] });
// $ExpectType Requireable
AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string);
// $ExpectType Requireable
AirbnbPropTypes.elementType(ClassComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType(FuncComp);
// $ExpectType Requireable
AirbnbPropTypes.elementType('div');
// $ExpectType Requireable
AirbnbPropTypes.elementType('*');
// $ExpectError
AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div');
// $ExpectType Requireable
AirbnbPropTypes.explicitNull();
// $ExpectType Validator
AirbnbPropTypes.explicitNull().isRequired;
interface ForbidShape {
foo: string;
bar: number;
baz?: boolean | null;
}
// $ExpectType ValidationMap<{ foo: string | null | undefined; bar: number; baz: boolean | null | undefined; }>
AirbnbPropTypes.forbidExtraProps({