Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-unused-prop-types] test cases #1343

Merged
merged 1 commit into from Aug 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/lib/rules/no-unused-prop-types.js
Expand Up @@ -2012,6 +2012,23 @@ ruleTester.run('no-unused-prop-types', rule, {
'}'
].join('\n'),
parser: 'babel-eslint'
}, {
// issue #933
code: [
'type Props = {',
' onMouseOver: Function,',
' onClick: Function,',
'};',

'const MyComponent = (props: Props) => (',
'<div>',
' <button onMouseOver={() => props.onMouseOver()} />',
' <button onClick={() => props.onClick()} />',
'</div>',
');'
].join('\n'),
parser: 'babel-eslint',
options: [{skipShapeProps: false}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to clarify; this example should work identically both with and without skipShapeProps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it doesn't have any effect. The props are not shape.

}
],

Expand Down