I am working on a Typescript React project and I usually put placeholder variables into the code so everything is laid out until I get to implementing everything. This leads to a bunch of eslint no-unused-vars
errors and makes finding real errors a challage.
How can I disable this globally until I am ready for it? I used create-react-app my-app --typescript
and don't want to eject the project but not sure how to disable this warning.
I noticed there is a eslintConfig
section in the package.json
so I tried to turn off the error there but it doesn't seem to work, is there a command I need to run after editing the package.json
or is my syntax incorrect?
"eslintConfig": {
"extends": "react-app",
"rules": {
"no-unused-vars": "off"
}
},
Update
(removed tsconfig.json
reference)
I updated my package.json
and keep getting the errors.
"eslintConfig": {
"extends": "react-app",
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
},
I tried moving the rules into a .eslintrc.json
file in the root of the project and still doesn't seem to turn this off.
The only thing that seems to work is putting // eslint-disable-line @typescript-eslint/no-unused-vars
after the variable.
package.json
to reference this file or is it supposed to find it automatically? I tried making atslint.json
in my app's root with the rules section from above and it doesn't seem to work.create-react-app
it should have already created one for you. I just did that and it did it for me