Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Recently, I have been working on some PRs for typescript-eslint, and I have noticed a bug in the setup of this repository.
In thetsconfig.base.json file, the "noUnusedLocals" and the "noUnusedParameters" compiler flags are specified. Normally, turning these on these flags provides extra safety for a TypeScript project. However, if the repository also uses the "@typescript-eslint/no-unused-vars" rule, then these compiler warnings become (mostly) superfluous.
For example, this unused variable triggers a buggy rule overlap:
The solution for this is to either turn the compiler flags off, or to turn the ESLint rule off.
This conflict is discussed in more detail in issue#4641 by Brad. Brad says that in general, he recommends that you use the ESLint rule over the compiler flags. This is what I have been doing in my own projects as well. I like it because ESLint has the feature where you can quickly ignore the warning by prefixing the variable with an underscore. (The TypeScript compiler does not understand this, and will continue to warn you about the variable even after putting an underscore on it.)
I think Brad's advice should also be applied to this monorepo as well, thus this issue.
Finally, a maintainer should remove thepackage: eslint-plugin
tag; I had to choose this arbitrarily since there did not seem to be an issue template for issues relating to the monorepo itself.