Skip to content
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

[no-invalid-void-type] another use case for void type #2165

Closed
yangmingshan opened this issue Jun 3, 2020 · 1 comment
Closed

[no-invalid-void-type] another use case for void type #2165

yangmingshan opened this issue Jun 3, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@yangmingshan
Copy link

Repro

https://www.typescriptlang.org/play/index.html#code/PTAEBUAsEsGdQO7QDbNAYwIYFdYFNQ8AnIgeyICgAzbAO3QBdpTbQG9YGAKBmWALlB0AJnirRaeYQEpQAb1ABfChRCgAQtgZs+iFGgBGBcZNVga9JizYduvOIIBupaDPlKV7Tl2lA

{
  "rules": {
    "@typescript-eslint/no-invalid-void-type": "error"
  }
}
function test(this: void) { }
test()

Expected Result
No error.

Actual Result
Error: void is only valid as a return type or generic type variable

Additional Info
I think this is another valid use case that should be supported. Real life use case: vuejs/core#605

Versions

package version
@typescript-eslint/eslint-plugin 3.1.0
@typescript-eslint/parser 3.1.0
TypeScript 3.9.3
ESLint 7.1.0
node 14.4.0
npm 6.14.5
@yangmingshan yangmingshan added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 3, 2020
@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for maintainers to take a look labels Jun 3, 2020
@bradzacher
Copy link
Member

See #2148
Please use the search

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants