We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Prefer checking isEmpty over comparing string to an empty array literal.
isEmpty
This reflects the behaviour already implemented by empty_string.
empty_string
if myArray == [] { … } guard list != [] else { return } if [] == anArray { … } theArray==[] ? return : f(theArray)
let myArray = [] if myArray.isEmpty { … } guard list.isEmpty else { return } if myArray == [1, 2, 3] { … }
No.
Same as for empty_string.
The text was updated successfully, but these errors were encountered:
empty_collection_literal
Successfully merging a pull request may close this issue.
New Issue Checklist
New rule request
Prefer checking
isEmpty
over comparing string to an empty array literal.This reflects the behaviour already implemented by
empty_string
.What would trigger
What would not trigger
3. Should the rule be configurable, if so what parameters should be configurable?
No.
4. Should the rule be opt-in or enabled by default? Why?
Same as for
empty_string
.The text was updated successfully, but these errors were encountered: