Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

FP no-useless-cast (S4325): boolean literal as operand #829

Open
vilchik-elena opened this issue Feb 8, 2019 · 0 comments
Open

FP no-useless-cast (S4325): boolean literal as operand #829

vilchik-elena opened this issue Feb 8, 2019 · 0 comments

Comments

@vilchik-elena
Copy link
Contributor

See #482, Reported in #828

const right = {
    error: true as true // cast is flagged as unnecessary
}

typeof right.error // true

const wrong = {
    error: true
}

typeof wrong.error; // boolean
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant