Here is a example for PropTypes:
import PropTypes from \'prop-types\';
class Greeting extends React.Component {
render() {
return (
Hello,
My personal recommendation is using a static code analysis tool as Aluan Haddad mentioned.
If you don't want to use a static code analysis tool, you could try to make the code fail on tests using a tool like https://github.com/esphen/jest-prop-type-error. But this implies you should have tests covering the integration between different components completely.
I would not consider this as a final solution for this problem but could be helpful as a temporary solution for large codebases while migrating to a static code analysis tool.