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

Conversation

DianaSuvorova
Copy link
Contributor

@DianaSuvorova DianaSuvorova commented Aug 4, 2017

fixes #933

code: [
'type ObjectType = {',
' usedDirectly: string;',
' usedFromArray: string;',
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this example only pass when skipShapeProps is false, but fail when it's true?

If so, could we add an explicit config option?

' greeting: string;',
'};',

'type Props = AProps & BProps;',
Copy link
Member

Choose a reason for hiding this comment

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

ok so this should either mean "name and age and greeting", or "name and age, or greeting" - in the former case, "age" is missing, in the latter case, "greeting" and "name" are mutually exclusive. Shouldn't this be an error?

@ljharb ljharb added the flow label Aug 5, 2017
@DianaSuvorova
Copy link
Contributor Author

Whoops, I got carried away, closing too many tickets at once.
None of the cases I added would work with skipShapeProps: false except for #933. Issue #1008 looks like a legitimate error. I think the rest should be kept open if we want to fix flow props validation. I updated a PR. thanks!

');'
].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.

@ljharb ljharb merged commit 1a622ea into jsx-eslint:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

no-unused-prop-types false positive when prop is used in function
2 participants