@@ -1151,6 +1151,17 @@ ruleTester.run('prop-types', rule, {
1151
1151
'}'
1152
1152
] . join ( '\n' ) ,
1153
1153
parser : 'babel-eslint'
1154
+ } , {
1155
+ code : [
1156
+ 'import type { FieldProps } from "redux-form"' ,
1157
+ '' ,
1158
+ 'type Props = {' ,
1159
+ 'label: string,' ,
1160
+ ' type: string,' ,
1161
+ ' options: Array<SelectOption>' ,
1162
+ '} & FieldProps'
1163
+ ] . join ( '\n' ) ,
1164
+ parser : 'babel-eslint'
1154
1165
} , {
1155
1166
code : [
1156
1167
'Card.propTypes = {' ,
@@ -1699,7 +1710,7 @@ ruleTester.run('prop-types', rule, {
1699
1710
1700
1711
class Bar extends React.Component {
1701
1712
props: Props;
1702
-
1713
+
1703
1714
render() {
1704
1715
return <div>{this.props.foo} - {this.props.bar}</div>
1705
1716
}
@@ -1715,7 +1726,7 @@ ruleTester.run('prop-types', rule, {
1715
1726
1716
1727
class Bar extends React.Component {
1717
1728
props: Props & PropsC;
1718
-
1729
+
1719
1730
render() {
1720
1731
return <div>{this.props.foo} - {this.props.bar} - {this.props.zap}</div>
1721
1732
}
@@ -1731,7 +1742,7 @@ ruleTester.run('prop-types', rule, {
1731
1742
1732
1743
class Bar extends React.Component {
1733
1744
props: Props & PropsC;
1734
-
1745
+
1735
1746
render() {
1736
1747
return <div>{this.props.foo} - {this.props.bar} - {this.props.zap}</div>
1737
1748
}
@@ -1743,12 +1754,12 @@ ruleTester.run('prop-types', rule, {
1743
1754
type PropsA = { bar: string };
1744
1755
type PropsB = { zap: string };
1745
1756
type Props = PropsA & {
1746
- baz: string
1757
+ baz: string
1747
1758
};
1748
1759
1749
1760
class Bar extends React.Component {
1750
1761
props: Props & PropsB;
1751
-
1762
+
1752
1763
render() {
1753
1764
return <div>{this.props.bar} - {this.props.zap} - {this.props.baz}</div>
1754
1765
}
@@ -1760,12 +1771,12 @@ ruleTester.run('prop-types', rule, {
1760
1771
type PropsA = { bar: string };
1761
1772
type PropsB = { zap: string };
1762
1773
type Props = {
1763
- baz: string
1774
+ baz: string
1764
1775
} & PropsA;
1765
1776
1766
1777
class Bar extends React.Component {
1767
1778
props: Props & PropsB;
1768
-
1779
+
1769
1780
render() {
1770
1781
return <div>{this.props.bar} - {this.props.zap} - {this.props.baz}</div>
1771
1782
}
@@ -3453,7 +3464,7 @@ ruleTester.run('prop-types', rule, {
3453
3464
3454
3465
class MyComponent extends React.Component {
3455
3466
props: Props;
3456
-
3467
+
3457
3468
render() {
3458
3469
return <div>{this.props.foo} - {this.props.bar} - {this.props.fooBar}</div>
3459
3470
}
@@ -3472,7 +3483,7 @@ ruleTester.run('prop-types', rule, {
3472
3483
3473
3484
class Bar extends React.Component {
3474
3485
props: Props & PropsC;
3475
-
3486
+
3476
3487
render() {
3477
3488
return <div>{this.props.foo} - {this.props.bar} - {this.props.zap} - {this.props.fooBar}</div>
3478
3489
}
@@ -3487,12 +3498,12 @@ ruleTester.run('prop-types', rule, {
3487
3498
type PropsB = { bar: string };
3488
3499
type PropsC = { zap: string };
3489
3500
type Props = PropsB & {
3490
- baz: string
3501
+ baz: string
3491
3502
};
3492
3503
3493
3504
class Bar extends React.Component {
3494
3505
props: Props & PropsC;
3495
-
3506
+
3496
3507
render() {
3497
3508
return <div>{this.props.bar} - {this.props.baz} - {this.props.fooBar}</div>
3498
3509
}
@@ -3507,12 +3518,12 @@ ruleTester.run('prop-types', rule, {
3507
3518
type PropsB = { bar: string };
3508
3519
type PropsC = { zap: string };
3509
3520
type Props = {
3510
- baz: string
3521
+ baz: string
3511
3522
} & PropsB;
3512
3523
3513
3524
class Bar extends React.Component {
3514
3525
props: Props & PropsC;
3515
-
3526
+
3516
3527
render() {
3517
3528
return <div>{this.props.bar} - {this.props.baz} - {this.props.fooBar}</div>
3518
3529
}
0 commit comments