Bug: [no-unsafe-enum-comparison] false positive with enums in a union with branded types #7114
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.0.3&sourceType=module&showAST=es&code=KYOwrgtgBAYg9nKBvAsAKClAglAvFAcgEMCAadAX3XQBcBPAB2CgCEiAnPKACgGcb2ASxABzKADJkUAPrSARuyIgAJgC4oYEAGsQcAO4goFAJRQAPrAQBuammXAAxgBsOzB3BD8ocjurbsbNHRBADMeH05cKMI5AlNUDCgAeiTKdCA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tieQEMAZonpNYAW1pkOY4nyrIOTdFETRoHaJHBgAviB1A&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA
Repro Code
ESLint Config
tsconfig
No response
Expected Result
No error
Actual Result
The rule errors on the comparison because it doesn't recognise the branded type as the base type
Additional Info
No response
The text was updated successfully, but these errors were encountered: