Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 845 Bytes

jsx-no-invalid-props.md

File metadata and controls

25 lines (15 loc) · 845 Bytes

JSX No invalid props (jsx-no-invalid-props)

Validates all x.propTypes = { ... } and x.contextTypes = { ... } statements for proper syntax (also as class members).

Rule Details

This rule checks propTypes on a class and validates the PropTypes against a static list from the React docs.

It supports arrays, shapes etc, nested to any depth.

The validation is rather strict; hopefully it will not generate false error reports. Please report any broken error reports you may encounter.

Rule Options

None yet

Todo

Make more intelligent when determining PropTypes i.e. could have been imported as "p" which would currently fail:

propTypes: {
    a: p.array
};