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

Create rule S6748: React children should not be passed as prop #3014

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 5, 2023

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:

  • logical errors and incorrect information
  • information gaps and missing content
  • text style and tone
  • PR summary and labels follow the guidelines

@alex-sonar alex-sonar changed the title Create rule S6748 Create rule S6748: React "children" should not be passed as prop Sep 6, 2023
@alex-sonar alex-sonar marked this pull request as ready for review September 6, 2023 13:43
@alex-sonar alex-sonar changed the title Create rule S6748: React "children" should not be passed as prop Create rule S6748: React children should not be passed as prop Sep 6, 2023
@@ -0,0 +1,26 @@
{
"title": "React \"children\" should not be passed as prop",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"title": "React \"children\" should not be passed as prop",
"title": "React children components should not be passed as prop",

Copy link
Contributor

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' })
----

Copy link
Contributor

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?

Copy link
Contributor

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-next
Copy link

SonarQube Quality Gate for 'rspec-tools'

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqube-next
Copy link

SonarQube Quality Gate for 'rspec-frontend'

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@alex-sonar alex-sonar merged commit bad8979 into master Sep 12, 2023
9 of 10 checks passed
@alex-sonar alex-sonar deleted the rule/add-RSPEC-S6748 branch September 12, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants