@@ -479,6 +479,56 @@ ruleTester.run('function-component-definition', rule, {
479479 options : [ {  namedComponents : 'function-expression'  } ] , 
480480 errors : [ {  messageId : 'function-expression'  } ] , 
481481 } , 
482+  { 
483+  code : ` 
484+  let Hello = (props) => { 
485+  return <div/>; 
486+  } 
487+  ` , 
488+  output : ` 
489+  let Hello = function(props) { 
490+  return <div/>; 
491+  } 
492+  ` , 
493+  options : [ {  namedComponents : 'function-expression'  } ] , 
494+  errors : [ {  messageId : 'function-expression'  } ] , 
495+  } , 
496+  { 
497+  code : ` 
498+  let Hello; 
499+  Hello = (props) => { 
500+  return <div/>; 
501+  } 
502+  ` , 
503+  output : ` 
504+  let Hello; 
505+  Hello = function(props) { 
506+  return <div/>; 
507+  } 
508+  ` , 
509+  options : [ {  namedComponents : 'function-expression'  } ] , 
510+  errors : [ {  messageId : 'function-expression'  } ] , 
511+  } , 
512+  { 
513+  code : ` 
514+  let Hello = (props) => { 
515+  return <div/>; 
516+  } 
517+  Hello = function(props) { 
518+  return <span/>; 
519+  } 
520+  ` , 
521+  output : ` 
522+  let Hello = function(props) { 
523+  return <div/>; 
524+  } 
525+  Hello = function(props) { 
526+  return <span/>; 
527+  } 
528+  ` , 
529+  options : [ {  namedComponents : 'function-expression'  } ] , 
530+  errors : [ {  messageId : 'function-expression'  } ] , 
531+  } , 
482532 { 
483533 code : ` 
484534 function Hello(props) { 
@@ -619,6 +669,54 @@ ruleTester.run('function-component-definition', rule, {
619669 errors : [ {  messageId : 'function-expression'  } ] , 
620670 features : [ 'types' ] , 
621671 } , 
672+  { 
673+  code : ` 
674+  import * as React from 'react'; 
675+  function Hello(props: Test) { 
676+  return React.createElement('div'); 
677+  } 
678+  ` , 
679+  output : ` 
680+  import * as React from 'react'; 
681+  const Hello = function(props: Test) { 
682+  return React.createElement('div'); 
683+  } 
684+  ` , 
685+  options : [ {  namedComponents : 'function-expression'  } ] , 
686+  errors : [ {  messageId : 'function-expression'  } ] , 
687+  features : [ 'types' ] , 
688+  } , 
689+  { 
690+  code : ` 
691+  export function Hello(props: Test) { 
692+  return React.createElement('div'); 
693+  } 
694+  ` , 
695+  output : ` 
696+  export const Hello = function(props: Test) { 
697+  return React.createElement('div'); 
698+  } 
699+  ` , 
700+  options : [ {  namedComponents : 'function-expression'  } ] , 
701+  errors : [ {  messageId : 'function-expression'  } ] , 
702+  features : [ 'types' ] , 
703+  } , 
704+  { 
705+  code : ` 
706+  function Hello(props) { 
707+  return React.createElement('div'); 
708+  } 
709+  export default Hello; 
710+  ` , 
711+  output : ` 
712+  const Hello = function(props) { 
713+  return React.createElement('div'); 
714+  } 
715+  export default Hello; 
716+  ` , 
717+  options : [ {  namedComponents : 'function-expression'  } ] , 
718+  errors : [ {  messageId : 'function-expression'  } ] , 
719+  } , 
622720 { 
623721 code : ` 
624722 var Hello = (props: Test) => { 
0 commit comments