Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[no-explicit-any] allowany in akeyof any expression #3206

Closed
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginwontfixThis will not be worked on
@iliazeus

Description

@iliazeus
  • 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

packageversion
@typescript-eslint/eslint-plugin4.18.0
@typescript-eslint/parser4.18.0
TypeScript4.2.3
ESLint7.22.0
node14.15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp