File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
tests/fixtures/custom-jsx Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -596,6 +596,19 @@ function isSortableTemplateExpression(
596
596
}
597
597
}
598
598
599
+ if ( node . tag . type === 'CallExpression' ) {
600
+ let func = node . tag . callee
601
+
602
+ // If the tag is a CallExpression we should traverse all CallExpression's until we find the leading Identifier
603
+ while ( func . type === 'CallExpression' ) {
604
+ func = func . callee
605
+ }
606
+
607
+ if ( func . type === 'Identifier' ) {
608
+ return functions . has ( func . name )
609
+ }
610
+ }
611
+
599
612
return false
600
613
}
601
614
@@ -626,6 +639,19 @@ function isSortableCallExpression(
626
639
}
627
640
}
628
641
642
+ if ( node . callee . type === 'CallExpression' ) {
643
+ let func = node . callee . callee
644
+
645
+ // If the tag is a CallExpression we should traverse all CallExpression's until we find the leading Identifier
646
+ while ( func . type === 'CallExpression' ) {
647
+ func = func . callee
648
+ }
649
+
650
+ if ( func . type === 'Identifier' ) {
651
+ return functions . has ( func . name )
652
+ }
653
+ }
654
+
629
655
return false
630
656
}
631
657
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ const k = tw.foo('sm:p-1 p-2');
14
14
const l = tw . foo . bar ( 'sm:p-1 p-2' ) ;
15
15
const m = no . foo ( 'sm:p-1 p-2' ) ;
16
16
const n = no . tw ( 'sm:p-1 p-2' ) ;
17
+ const o = tw ( Foo ) `sm:p-1 p-2` ;
18
+ const p = tw ( Foo ) ( Bar ) `sm:p-1 p-2` ;
19
+ const q = no ( Foo ) `sm:p-1 p-2` ;
20
+ const r = no . tw ( Foo ) `sm:p-1 p-2` ;
21
+ const s = tw ( Foo ) ( 'sm:p-1 p-2' ) ;
22
+ const t = tw ( Foo ) ( Bar ) ( 'sm:p-1 p-2' ) ;
23
+ const u = no ( Foo ) ( 'sm:p-1 p-2' ) ;
24
+ const v = no . tw ( Foo ) ( 'sm:p-1 p-2' ) ;
17
25
18
26
const A = ( props ) => < div className = { props . sortMe } /> ;
19
27
const B = ( ) => < A sortMe = "sm:p-1 p-2" dontSort = "sm:p-1 p-2" /> ;
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ const k = tw.foo("p-2 sm:p-1");
14
14
const l = tw . foo . bar ( "p-2 sm:p-1" ) ;
15
15
const m = no . foo ( "sm:p-1 p-2" ) ;
16
16
const n = no . tw ( "sm:p-1 p-2" ) ;
17
+ const o = tw ( Foo ) `p-2 sm:p-1` ;
18
+ const p = tw ( Foo ) ( Bar ) `p-2 sm:p-1` ;
19
+ const q = no ( Foo ) `sm:p-1 p-2` ;
20
+ const r = no . tw ( Foo ) `sm:p-1 p-2` ;
21
+ const s = tw ( Foo ) ( "p-2 sm:p-1" ) ;
22
+ const t = tw ( Foo ) ( Bar ) ( "p-2 sm:p-1" ) ;
23
+ const u = no ( Foo ) ( "sm:p-1 p-2" ) ;
24
+ const v = no . tw ( Foo ) ( "sm:p-1 p-2" ) ;
17
25
18
26
const A = ( props ) => < div className = { props . sortMe } /> ;
19
27
const B = ( ) => < A sortMe = "p-2 sm:p-1" dontSort = "sm:p-1 p-2" /> ;
You can’t perform that action at this time.
0 commit comments