Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 689 Bytes

prop-types.md

File metadata and controls

40 lines (32 loc) · 689 Bytes

Prevent definitions of unused prop types and prevent missing props validation (react-pug/prop-types)

  • Prevent props used in components to be incorrectly marked as unused
  • Request defined prop types to be used in components

Rule Details

The following patterns are considered warnings:

const Component = props => pug`
  = props.test
`
const Component = () => pug`
  span Hello
`
Component.propTypes = {
  test: PropTypes.string,
}

The following patterns are not considered warnings:

const Component = props => pug`
  = props.test
`
Component.propTypes = {
  test: PropTypes.string,
}
const Component = () => pug`
  span Hello
`