Linting errors for unused/undefined variables in React

29 Views Asked by At

I'm writing some React code and noticed from my tutorial videos that their unused variables have the red squiggly lines under unused/undefined variables. For me the unused/undefined variables are greyed out, which is not helpful when there are more lines of code in a Component file.

package.json file

example code

I believe my React project is configured using Vite, and I've tried editing the "Lint" key in my package.json file, almost exhausted all VSCode/ESLint setting but still didn't get it to work. I even tried setting up external .eslintrc.json file but I don't think that's the solution either. Any idea of what I'm missing or doing it wrong?

0

There are 0 best solutions below