facebook/react — pull request #2060 by erikbrannstrom (2014-08-18 09:56:14+00:00)
Title: Warn when propTypes does not specify a received prop

When developing, it's easy to occasionally forget about specifying all component props in propTypes. Once you've gone on for a while without doing this, identifying and adding all these missing props is quite the hassle.

This pull request adds a warning when a prop is not specified in propTypes, however only if propTypes is actually defined (an empty object is fine). This is pretty much was discussed in issue #1587.

I willingly admit I am slightly out of my depth here, especially regarding the code in ReactDescriptorValidator.js. The code is duplicated between that file and ReactCompositeComponent.js, but it seems to be the case with the existing validation as well.

I've added a test case for this and it succeeded, though since 04c982 it seems I can't run any tests at all (even on master).

It might be this feature should only be enabled after the user explicitly says so, but I thought I'd send this in anyway for discussion.