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
Ignore React FC for #Cognitive Complexity #226
Comments
To be clear, React function components are not completely ignored, only there own complexity is counted (excluding nested functions). So I can't tell if you have FP looking at such reproducer. |
But in my use case, I see that even the nested functions are being counted. Shouldn't the FCs behave like Class Components? |
@papuruth As I said already for FC "there own complexity is counted (excluding nested functions)". If you observe different behaviour please post full reproducer. |
FYI there is one fix on the way (#245) so may be that was your problem |
closing the issue as no answer from the reporter |
I want to report a bug.
I have upgraded eslint-plugin-sonarjs to latest version i.e., 0.8.0-125, but still I'm receiving error for cognitive complexity on React FC. An screenshot has been attached.
Reproducer
Expected behavior
React FC should be ignored from this rule.
eslint-plugin-sonarjs version: 0.8.0-125
eslint version: 6.6.0
Node.js version: 12.16.1
Rule key: S3776
The text was updated successfully, but these errors were encountered: