@@ -406,6 +406,18 @@ ruleTester.run('jsx-no-bind', rule, {
406
406
errors : [ { message : 'JSX props should not use arrow functions' } ] ,
407
407
parser : 'babel-eslint'
408
408
} ,
409
+ {
410
+ code : [
411
+ 'class Hello23 extends React.Component {' ,
412
+ ' renderDiv = async () => {' ,
413
+ ' const click = async () => true' ,
414
+ ' return <div onClick={click}>Hello</div>;' ,
415
+ ' }' ,
416
+ '};'
417
+ ] . join ( '\n' ) ,
418
+ errors : [ { message : 'JSX props should not use arrow functions' } ] ,
419
+ parser : 'babel-eslint'
420
+ } ,
409
421
{
410
422
code : [
411
423
'var Hello = React.createClass({' ,
@@ -416,6 +428,16 @@ ruleTester.run('jsx-no-bind', rule, {
416
428
] . join ( '\n' ) ,
417
429
errors : [ { message : 'JSX props should not use arrow functions' } ]
418
430
} ,
431
+ {
432
+ code : [
433
+ 'var Hello = React.createClass({' ,
434
+ ' render: function() { ' ,
435
+ ' return <div onClick={async () => true} />' ,
436
+ ' }' ,
437
+ '});'
438
+ ] . join ( '\n' ) ,
439
+ errors : [ { message : 'JSX props should not use arrow functions' } ]
440
+ } ,
419
441
{
420
442
code : [
421
443
'var Hello = React.createClass({' ,
@@ -427,6 +449,17 @@ ruleTester.run('jsx-no-bind', rule, {
427
449
] . join ( '\n' ) ,
428
450
errors : [ { message : 'JSX props should not use arrow functions' } ]
429
451
} ,
452
+ {
453
+ code : [
454
+ 'var Hello = React.createClass({' ,
455
+ ' render: function() { ' ,
456
+ ' const doThing = async () => true' ,
457
+ ' return <div onClick={doThing} />' ,
458
+ ' }' ,
459
+ '});'
460
+ ] . join ( '\n' ) ,
461
+ errors : [ { message : 'JSX props should not use arrow functions' } ]
462
+ } ,
430
463
{
431
464
code : [
432
465
'class Hello23 extends React.Component {' ,
0 commit comments