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
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
{"rules": {"@typescript-eslint/no-explicit-any":2 }}
functiongetNumber<Kextendskeyofany,Textends{[PinK]:number}>(key:K,obj:T):number{returnobj[key];}
Currently, the expressionkeyof any
is probably the only (sane) way of saying "a type of things that can be object keys". But it is disallowed underno-explicit-any
.
The long way ofstring | number | symbol
isn't portable enough because of thesymbol
part.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 4.18.0 |
@typescript-eslint/parser | 4.18.0 |
TypeScript | 4.2.3 |
ESLint | 7.22.0 |
node | 14.15.4 |