Skip to content

Commit

Permalink
Fix classes with properties to always be marked as components (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Nov 7, 2015
1 parent a09ac73 commit 2929aaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/Components.js
Expand Up @@ -206,7 +206,7 @@ function componentRule(rule, context) {
scope = scope.upper;
}
var node = scope && scope.block;
if (!node || !node.superClass) {
if (!node || !context.react.isES6Component(node)) {
return null;
}
return node;
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/rules/display-name.js
Expand Up @@ -57,6 +57,16 @@ ruleTester.run('display-name', rule, {
classes: true,
jsx: true
}
}, {
code: [
'class Hello extends Greetings {',
' static text = \'Hello World\';',
' render() {',
' return Hello.text;',
' }',
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
code: [
'class Hello {',
Expand Down

0 comments on commit 2929aaa

Please sign in to comment.