-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancementNew feature or requestNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Description
Repro
{
"rules": {
"@typescript-eslint/no-invalid-void-type": ["error"]
}
}
interface ClassWithStaticMethod {
method(this: void): void;
}
Expected Result: Should not return an error here, as this: void
clarifies that the method is static.
Actual Result: Throws an error saying that void is only valid as a return type or generic type variable.
Additional Info: TypeScript specially refers to "this in void context" which clarifies that void
is the right type here, not undefined
.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.34.0 |
@typescript-eslint/parser |
2.34.0 |
TypeScript |
3.9.3 |
ESLint |
7.0.0 |
node |
12.16.3 |
yarn |
1.22.4 |
jirutka
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin