We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cb2e9e commit c502d72Copy full SHA for c502d72
lib/rules/forbid-prop-types.js
@@ -33,7 +33,7 @@ module.exports = function(context) {
33
// (babel-eslint does not expose property name so we have to rely on tokens)
34
if (node.type === 'ClassProperty') {
35
var tokens = context.getFirstTokens(node, 2);
36
- if (tokens[0].value === 'propTypes' || tokens[1].value === 'propTypes') {
+ if (tokens[0].value === 'propTypes' || (tokens[1] && tokens[1].value === 'propTypes')) {
37
return true;
38
}
39
return false;
0 commit comments