I'm trying to run npm build but I get "no-unused-vars" errors. I'd like to disable these.
My project is build with create-react-app (https://github.com/facebook/create-react-app), React + Typescript + Vite.
What I have tried:
tsconfig.json
"compilerOptions": { "noUnusedLocals": false, "noUnusedParameters": false, }
eslint.config.json
"no-unused-vars": [ "error", { caughtErrors: "none" } ],
"@typescript-eslint/no-unused-vars": ["off"]
.eslintrc.js
module.exports = {
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
}
}
package.json
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off"
}
What's the proper way to disable the "no-unused-var" errors in my React project? What should I try other than these solutions that haven't worked for me?
Disclaimer: I am NOT looking to put "_" before variables or suppressing the error with comments.
I expected the project to build without giving me "no-unused-vars" errors.
overridesto your ESLint config but it's not clear from your question if that's what you're doing.