Skip to content

Bug: [prefer-promise-reject-errors (and other rules too)] Cannot convert Symbol to string (8.6.0 regression) #9999

Closed
@AviVahl

Description

@AviVahl

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.5.2&fileType=.tsx&code=KYDwDg9gTgLgBAYwDYEMDOa4FkVgErADmAlmjFAJ4A8A0gDRwAqAfHAN4BQccYArgEZJiCOMRjAAtpgC8cAHbAA7tly0GLABQBKANxceAoSIDaAZQoT%2BEJADoxwKChjQAutvb7uUYDF5Q5cDAAFqR24lJmFla29o7OUG66%2BgC%2BHKlAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Y6RAM0Wlo4D2AW0rJEtTgCtEZOr2gDoqDJHmLI4MAF8QWoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

export class MapRegistry<K, T> {
  public items = new Map<K, T>();
  public [Symbol.iterator]() {
    return this.items[Symbol.iterator]();
  }
}

ESLint Config

{
  "rules": {
    "@typescript-eslint/prefer-promise-reject-errors": "error"
  }
}

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

lint should pass

Actual Result

TypeError: Cannot convert a Symbol value to a string

Additional Info

8.5.0 works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: 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