-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Use regex.test() when we want to check for a Boolean. #29969
Conversation
if (tabClass !== null && tabClass.length) { | ||
tabClass | ||
.map(token => token.trim()) | ||
if (tabClass !== null && tabClass.length > 0) { |
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.
tabClass.length
is equal too tabClass.length > 0
not really needed that change
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.
It's what we do in popover.js; this code is exactly the same
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.
So we can change that in popover.js
too 😄 but it's nitpicking
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.
Fine by me, I'd just prefer if we enforced this with a rule, but I cannot find one, only for the opposite unicorn/explicit-length-check
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.
LGTM 👍
I don't think it's really needed to backport that
…n. (twbs#29969)" (twbs#30770) This partially reverts commit 9c2b9ac.
Not sure if we should backport this