-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Add no-useless-length-check
rule
#1398
Add no-useless-length-check
rule
#1398
Conversation
…ate this rule" This reverts commit 3d70587.
rules/no-useless-length-check.js
Outdated
'non-zero': '`Array#some()` returns `false` on empty array, the empty check is not needed.', | ||
zero: '`Array#every()` returns `true` on empty array, the non-empty check is not needed.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'non-zero': '`Array#some()` returns `false` on empty array, the empty check is not needed.', | |
zero: '`Array#every()` returns `true` on empty array, the non-empty check is not needed.' | |
'non-zero': 'The empty check is useless as `Array#some()` returns `false` for an empty array.', | |
zero: 'The non-empty check is useless as `Array#every()` returns `true` for an empty array.' |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message seems not right, I'll double-check the logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message was wrong about the length check node, fixed.
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Not finished yet, nested logic operators are complicated.Fixes #897