Skip to content

Commit

Permalink
Create failing no-unused-prop-types test with union flowtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
justinanastos committed Nov 22, 2017
1 parent 16e57ff commit 077e017
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,28 @@ ruleTester.run('no-unused-prop-types', rule, {
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
code: [
'type PropsUnionA = {',
' a: string,',
' b?: void,',
'};',
'type PropsUnionB = {',
' a?: void,',
' b: string,',
'};',
'type Props = {',
' name: string,',
'} & (PropsUnionA | PropsUnionB);',
'class Hello extends React.Component {',
' props: Props;',
' render() {',
' const {name} = this.props;',
' return name;',
' }',
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
code: [
'Card.propTypes = {',
Expand Down

0 comments on commit 077e017

Please sign in to comment.