Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed as not planned
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
declarefunctionmx<T>():T;mx<void>();logAndReturn<void>(undefined);letvoidPromise:Promise<void>=newPromise<void>(()=>{});letvoidMap:Map<string,void>=newMap<string,void>();
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/no-invalid-void-type":"error"},};
tsconfig
{"compilerOptions": {// ... }}
Expected Result
I expected all of these to be considered valid uses ofvoid
Actual Result
Only the last two uses are considered valid.
Additional Info
Maybe I'm missing something but I've read the docs a couple of times and the issues, and I can't find anything explaining why this general use ofvoid
is being flagged - or inversely, anything confirming that there is more logic than just "is this a generic?".
Importantly thelogAndReturn
is taken from the documentation itself for showcasing
The following patterns are considered warnings with { allowInGenericTypeArguments: false }:
Which implies to me those patterns shouldnot be considered warnings ifallowInGenericTypeArguments
is true. This seems to be happening from v5 onwards.