While fixing #437 I realized that the styleguidist would be able to print an info message when the user uses a defaultProp that is not listed in propTypes
In getProps.js line 73 it could look something like this:
let documentation = '';
if (prop.description === undefined) {
console.log(`[react-styleguidist props analyzation] The prop ${propName} in ${doc.displayName} is listed in defaultProps but not in propTypes.`);
}
else {
documentation = doctrine.parse(prop.description);
}
What do you think? Is it an helpful addition or not the task of the styleguidist to analyze the users code in this way?
I鈥檓 sure eslint-plugin-react can do that as well as many other things. I think it鈥檚 way out of scope of Styleguidist and other tools already exist that do that much better.
Closing since eslint-plugin-react is clearly the better way to approach this kind of thing
Most helpful comment
I鈥檓 sure eslint-plugin-react can do that as well as many other things. I think it鈥檚 way out of scope of Styleguidist and other tools already exist that do that much better.