-
Notifications
You must be signed in to change notification settings - Fork 105
Support no-unused-vars rule like in eslint #171
Comments
The function someFunctionInProgress(a: number, b: number) {
console.log("I'm not going to use the value of a, just b:", b);
} This type of function would raise the the error that function someFunctionInProgress(_a: number, b: number) {
console.log("typescript is happy even if i don't use the first argument: b = ", b);
} I much rather add the prefix See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#flag-unused-declarations-with---nounusedparameters-and---nounusedlocals for info on the prefix. |
I known about prefix For this reason I apply linter only after compilation. Now I must disable Problem can be solved if typescript compiler will add support for error severities: print warnings for unused locals, but compile code anyway. |
|
Time to update the docs stating that it is available on tslint. I'll reopen to have it as a reminder. |
Rule |
Rule no-unused-vars rule was deprecated in
tslint
.But recommended
TypeScript
options--noUnusedParameters
and--noUnusedLocals
have a lot of limitations:Also TypeScript options
noUnusedLocals
andnoUnusedParameters
can produce errors during debugging, when unused temporary variables are not a problem. At this point of view linter is applied after compilation and can be disabled during debugging or testing.I propose to return this rule back and make it similar to eslint no-unused-vars rule.
The text was updated successfully, but these errors were encountered: