Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint against needless boolean #604

Open
chriscerie opened this issue Jun 14, 2024 · 0 comments
Open

Lint against needless boolean #604

chriscerie opened this issue Jun 14, 2024 · 0 comments
Labels
A-lints Area: Relating to a lint directly C-enhancement Category: Feature request or improvement

Comments

@chriscerie
Copy link
Collaborator

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
@chriscerie chriscerie added C-enhancement Category: Feature request or improvement A-lints Area: Relating to a lint directly labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Relating to a lint directly C-enhancement Category: Feature request or improvement
Projects
None yet
Development

No branches or pull requests

1 participant