gab
(Gabriel Vivas)
January 6, 2023, 8:48am
15
Hello @RomainJoly ,
We have decided to disable the S6480 rule by default for now, until we can get more information and improve the rule. It can still be enabled manually.
See the Github issue:
https://github.com/SonarSource/SonarJS/issues/3614
Also another thread on the same topic:
@saberduck if you’re talking about the OP his screenshot does show why.
He has a onClick which is taking goToPreviousStep which is a standalone function. Since it’s a standalone function it should trigger the violation.
For him to fix it he just needs to wrap it
const goToPreviousStep = useCallback(function goToPreviousStep() {
setActiveStep(activeStep - 1, []);
}
It’s a tedious fix but it is a valid violation.
Side note
Actually I have to correct myself earlier. I was mistaken that it…
For clarification, the memory issue faced by @jeffski has no relation to this particular rule.
Cheers,
Gabriel
3 Likes