-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix handling of identifiers #1356
Changes from 4 commits
69e5201
c98ce02
f072966
663838b
3c76731
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -563,6 +563,42 @@ ruleTester.run('sort-prop-types', rule, { | |
column: 5, | ||
type: 'Property' | ||
}] | ||
}, { | ||
code: [ | ||
'const First = (props) => <div />;', | ||
'const propTypes = {', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you also (just in case) add a test with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, just so I can understand, what behavior will that change be verifying? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully nothing; I'm just making sure that an export declaration works just as well as a variable declaration :-) |
||
' z: PropTypes.string,', | ||
' a: PropTypes.any,', | ||
'};', | ||
'First.propTypes = forbidExtraProps(propTypes);' | ||
].join('\n'), | ||
settings: { | ||
propWrapperFunctions: ['forbidExtraProps'] | ||
}, | ||
errors: [{ | ||
message: ERROR_MESSAGE, | ||
line: 4, | ||
column: 5, | ||
type: 'Property' | ||
}] | ||
}, { | ||
code: [ | ||
'const First = (props) => <div />;', | ||
'const propTypes = {', | ||
' z: PropTypes.string,', | ||
' a: PropTypes.any,', | ||
'};', | ||
'First.propTypes = propTypes;' | ||
].join('\n'), | ||
settings: { | ||
propWrapperFunctions: ['forbidExtraProps'] | ||
}, | ||
errors: [{ | ||
message: ERROR_MESSAGE, | ||
line: 4, | ||
column: 5, | ||
type: 'Property' | ||
}] | ||
}, { | ||
code: [ | ||
'var First = createReactClass({', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3