React - unused variables

Hello world, is there a way to disable the lint render is doing when I have unused variables?, it is wasting resources trying to upload and then fail because of this. I’m moving a site from CRA to Vite and I need to check that everything works when I deploy the app, I’ll take care of the unused variables later


1 Like

For a quick fix you could add this after any of the next object, key in your package.json file:

 "eslintConfig": {
    "rules": {
      "no-unused-vars": "off"

1 Like

Thanks for the reply, I tried your solution but I got the same error:

Nov 6 01:57:45 AM  ../server/routers/user.ts(2,1): error TS6133: 'z' is declared but its value is never read.
Nov 6 01:57:45 AM  ==> Build failed 😞

Any clue? It would be cool to avoid this!

1 Like

You need to dsable it from your Application locally before you push

This should help out

Hey @pablojsx you can prevent this in different ways

you can //@ts-ignore before that line, but this is not an efficent way, so just go to your liner config and turn of unused variables to false

Thanks for the replies, all good now I did almost all the refactor so I need it now

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.