Kampfkarren / selene

A blazing-fast modern Lua linter written in Rust
https://kampfkarren.github.io/selene/
Mozilla Public License 2.0
561 stars 76 forks source link

Lint against needless boolean #604

Open chriscerie opened 2 weeks ago

chriscerie commented 2 weeks ago

In luau only,

local _ = if <bool expr> then true else false

should be written as

local _ = <bool expr>

Some test cases

local _ = if x == y then true else false
local _ = if x ~= y then false else true
local _ = if stdlib.returnsBool() then true else false