Skip to content

Commit 430a89f

Browse files
Diana SuvorovaDiana Suvorova
authored andcommitted
moving test into invalid
1 parent 9d0707e commit 430a89f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/lib/rules/no-unused-prop-types.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,6 +3162,34 @@ ruleTester.run('no-unused-prop-types', rule, {
31623162
errors: [{
31633163
message: '\'name\' PropType is defined but prop is never used'
31643164
}]
3165+
}, {
3166+
code: [
3167+
'class Comp1 extends Component {',
3168+
' render() {',
3169+
' return <span />;',
3170+
' }',
3171+
'}',
3172+
'Comp1.propTypes = {',
3173+
' prop1: PropTypes.number',
3174+
'};',
3175+
'class Comp2 extends Component {',
3176+
' render() {',
3177+
' return <span />;',
3178+
' }',
3179+
'}',
3180+
'Comp2.propTypes = {',
3181+
' prop2: PropTypes.arrayOf(Comp1.propTypes.prop1)',
3182+
'};'
3183+
].join('\n'),
3184+
parser: 'babel-eslint',
3185+
errors: [{
3186+
message: '\'prop1\' PropType is defined but prop is never used'
3187+
}, {
3188+
message: '\'prop2\' PropType is defined but prop is never used'
3189+
}, {
3190+
message: '\'prop2.*\' PropType is defined but prop is never used'
3191+
}]
3192+
31653193
}
31663194
/* , {
31673195
// Enable this when the following issue is fixed

0 commit comments

Comments
 (0)