-
Notifications
You must be signed in to change notification settings - Fork 28
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
Create rule S6748: React children
should not be passed as prop
#3014
Conversation
children
should not be passed as prop
@@ -0,0 +1,26 @@ | |||
{ | |||
"title": "React \"children\" should not be passed as prop", |
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.
"title": "React \"children\" should not be passed as prop", | |
"title": "React children components should not be passed as prop", |
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 don't like the word components here because it can be interpreted as components only, i.e. excluding plain html elements or text content. So I will keep the title as is.
|
||
React.createElement("div", { children: 'Children' }) | ||
---- | ||
|
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.
Could you add a brief sentence explaining how to pass from the noncompliant to the compliant snippet?
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.
done.
Co-authored-by: Yassin Kammoun <52890329+yassin-kammoun-sonarsource@users.noreply.github.com>
SonarQube Quality Gate for 'rspec-tools' |
SonarQube Quality Gate for 'rspec-frontend' |
You can preview this rule here (updated a few minutes after each push).
SonarSource/SonarJS#4129
Review
A dedicated reviewer checked the rule description successfully for: