Skip to content

Linter should check for non-booleans in condition expressions #2183

@tapple

Description

@tapple

Expressions like this are idiomatic in other languages, but don't do what some people might expect in lua:

s = ""
if s then
   print("the string is not empty") -- yes it is
else
    print("the string is empty") 
end

The linter should warn about it

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions