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

Fix FP S6759 (prefer-read-only-props): Restrict the scope to functional components #4175

Closed
yassin-kammoun-sonarsource opened this issue Sep 15, 2023 · 0 comments · Fixed by #4182
Assignees
Labels
mmf-2857 https://sonarsource.atlassian.net/browse/MMF-2857 type: false positive Issue is reported when it should NOT be
Milestone

Comments

@yassin-kammoun-sonarsource
Copy link
Contributor

As reported here, S6759 (currently borrowing the implementation of prefer-read-only-props) raises false positives on React class components. The scope of the rule should be restricted to React functional components only. The rule should report on such components that neither use TypeScript's utility type Readonly nor pure read-only props interfaces/type aliases. The corresponding RSPEC should be updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mmf-2857 https://sonarsource.atlassian.net/browse/MMF-2857 type: false positive Issue is reported when it should NOT be
Projects
None yet
2 participants