Skip to content

Commit 4cbe946

Browse files
committed
Reproduce error using ES6 imports
1 parent f2a905c commit 4cbe946

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/lib/rules/react-in-jsx-scope.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,20 @@ eslintTester.addRuleTest('lib/rules/react-in-jsx-scope', {
2626
{code: 'var React, App, a=1; function elem() { return <App attr={a} />; }', ecmaFeatures: {jsx: true}},
2727
{code: 'var React, App; <App />;', args: [1, {vars: 'all'}], ecmaFeatures: {globalReturn: true, jsx: true}},
2828
{code: '/** @jsx Foo */ var Foo, App; <App />;', args: [1, {vars: 'all'}], ecmaFeatures: {jsx: true}},
29-
{code: '/** @jsx Foo.Bar */ var Foo, App; <App />;', args: [1, {vars: 'all'}], ecmaFeatures: {jsx: true}}
29+
{code: '/** @jsx Foo.Bar */ var Foo, App; <App />;', args: [1, {vars: 'all'}], ecmaFeatures: {jsx: true}},
30+
{code: [
31+
'import React from \'react/addons\';',
32+
'const Button = React.createClass({',
33+
' render() {',
34+
' return (',
35+
' <button {...this.props}>{this.props.children}</button>',
36+
' )',
37+
' }',
38+
'});',
39+
'export default Button;'
40+
].join('\n'),
41+
ecmaFeatures: {blockBindings: true, objectLiteralShorthandMethods: true, modules: true, jsx: true}
42+
}
3043
],
3144
invalid: [
3245
{code: 'var App, a = <App />;',

0 commit comments

Comments
 (0)