8000 Bug: [await-thenable] Also flag unknown · Issue #8301 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Bug: [await-thenable] Also flag unknown #8301
Closed as not planned
Closed as not planned
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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 have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.3.3&fileType=.ts&code=CYUwxgNghgTiAEYD2A7AzgF3hkmBc8ArigNYpIDuKA3AFAAUUaAnimPPQJTwC8AfPADetePCgUoASyw5MtAL6cu1IA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AQwHd3K78ALRE3YAjJOiiJo0APbRI4MAF8QSoA&tsconfig=&tokens=false

Repro Code

declare const test: unknown;
(async () => {
  await test
})();

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/await-thenable": "error"
  },
};

tsconfig

{}

Expected Result

There's no guarantee that an unknown-typed value is a Thenable. I'd expect the rule to report a complaint in this case.

Actual Result

No complaint.

Additional Info

await-thenable was first implemented in #192 back in 2019. TypeScript had previously released unknown in TypeScript 3.0 less than a year earlier.

Not detecting unknown was noted by @Tjstretchalot in #8094 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseIssues waiting for a reply from the OP or another partybugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0