require-default-props error message cannot handle quoted props #1161
Closed
Description
opened on Apr 24, 2017
The following is with eslint-plugin-react@6.10.3
.
If a propType is quoted for some reason like this:
MyComponent.propTypes = {
'data-id': PropTypes.string,
};
Then the require-default-props
rule gives the following warning:
propType "undefined" is not required, but has no corresponding defaultProp declaration.
Howwever, giving the propType a default value like this does satisfy the rule:
MyComponent.defaultProps = {
'data-id': 'test',
};
It seems like this is an issue with the formatting of the error message.
Activity