Skip to content

Bug: [no-misused-promises] inheritedMethods check should flag all statically analyzable declarations, not just identifiers and numbers. #10211

@kirkwaiblinger

Description

@kirkwaiblinger

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

LINK

Repro Code

const staticSymbol = Symbol.for('static symbol');

interface Interface {
  identifier: () => void;
  1: () => void;
  2: () => void;
  stringLiteral: () => void;
  computedStringLiteral: () => void;
  // well known symbol
  [Symbol.iterator]: () => void;

  // less sure if this one is possible to lint for
  [staticSymbol]: () => void;
}


class Clazz implements Interface {
  async identifier() { }
  async 1() { }
  async [2]() { }
  async 'stringLiteral'() { }
  async ['computedStringLiteral']() { }
  async [Symbol.iterator]() { };
  async [staticSymbol]() { };
}

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/no-misused-promises": "warn"
  }
}

tsconfig

{
  "compilerOptions": {
    "strict": true
  }
}

Expected Result

All method declarations should flag

Actual Result

Only async identifier() {} and async 1() {} flagged.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions