- ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
- Languages of the repository
I’m getting many warnings related to variables not being used. These are hooks setters and getters. For example:
const [state, setState] = useState();
Sometimes “state” is not used, so my question is, if I write this:
const [,setState] = useState()
to accomodate for the warning, it just looks wrong, and pontentially buggy code, it does not look like React code, readability is compromised, and there’s a potential bug if that comma is omitted.
Then it also happens that the setter is not used, and I could just leave it out, and even though I don’t see potential problems with that, it still does not look like react code.
What should I do? Or is there a setting to adjust to tell sonarcloud that is is JSX / react code and not plain JS?