-
-
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
require-default-props - fixing an edge case where linting stops early #1380
Conversation
@@ -1306,7 +1306,26 @@ ruleTester.run('require-default-props', rule, { | |||
column: 3 | |||
}] | |||
}, | |||
|
|||
// | |||
// component with no pros followed by a failing component |
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.
Typo.
Also is the empty //
needed?
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.
I was just following the pattern in the rest of the file, I have deleted it now though, since it does seem unnecessary 👍
// component with no pros followed by a failing component | ||
{ | ||
code: [ | ||
'var ComponentWithNoProps = ({ bar = "bar" }) => {', |
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.
It reads a bit confusing. It says component with no props
, but this component actually has two props: bar
and foo
. I guess that you actually mean; component with no declared prop types
(since there is no .propTypes
) for the first component.
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.
updated the comment and fixed typo:
"component with no declared props followed by a failing component"
Nice find! The fix looks good to me. I added a few comments about the tests. |
…it finds a component without props - should move on to the next component in the file
This is to fix an edge case where linting stops when it finds a component without props. Instead it should move on to the next component in the file.