-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-unused-vars] Prevent false positives with classes #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
you mention there's two violations. |
Whoops sorry. |
to me those violations look correct. |
Yikes, the latter two classes were supposed to extend Base. Fixed in the example code. |
Revisiting this - this will never be a truly supported use case. You can get around this using the following rule config, and by deleting the unused argument in /* eslint no-unused-vars: ['error', { argsIgnorePattern: "^_" }] */
class Base {
public f(_value: string) {
throw new Error("IllegalOperationError");
}
}
export class Impl extends Base {
public f(value: string) {
console.log(value);
}
}
export class SecondaryImpl extends Base {
public f() {
console.log("Irrelevant");
}
} |
Uh oh!
There was an error while loading. Please reload this page.
Repro
Expected Result
No violation
Actual Result
Violation (twice)
Additional Info
For some reason when I filed #52, I apparently thought this rule already did this, not sure why, but it's the same idea.
Versions
@typescript-eslint/eslint-plugin
1.9.0
@typescript-eslint/parser
1.9.0
TypeScript
3.3.4000
ESLint
5.15.3
node
8.11.3
npm
6.9.0
The text was updated successfully, but these errors were encountered: