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

Add rule S6754 (hook-use-state): The return value of "useState" should be destructured and named symmetrically #4152

Merged
merged 3 commits into from
Sep 12, 2023

Conversation

yassin-kammoun-sonarsource
Copy link
Contributor

Fixes #4141

@@ -0,0 +1,5 @@
import { useState } from 'react';
function MyComponent() {
Copy link
Contributor

Choose a reason for hiding this comment

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

please change MyComponent to useSomething to match custom hooks naming convention

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@sonarqube-next
Copy link

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource merged commit 746e232 into master Sep 12, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants