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

Use regex.test() when we want to check for a Boolean. #29969

Merged
merged 2 commits into from
Jan 7, 2020

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Jan 7, 2020

Not sure if we should backport this

@XhmikosR XhmikosR requested a review from Johann-S January 7, 2020 11:30
@XhmikosR XhmikosR requested a review from a team as a code owner January 7, 2020 11:30
if (tabClass !== null && tabClass.length) {
tabClass
.map(token => token.trim())
if (tabClass !== null && tabClass.length > 0) {
Copy link
Member

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

Copy link
Member Author

@XhmikosR XhmikosR Jan 7, 2020

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

Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

@Johann-S Johann-S left a 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

@XhmikosR XhmikosR merged commit 9c2b9ac into master Jan 7, 2020
@XhmikosR XhmikosR deleted the master-xmr-regex-test branch January 7, 2020 20:07
XhmikosR added a commit that referenced this pull request May 9, 2020
XhmikosR added a commit that referenced this pull request May 9, 2020
XhmikosR added a commit that referenced this pull request May 10, 2020
XhmikosR added a commit that referenced this pull request May 11, 2020
XhmikosR added a commit that referenced this pull request May 12, 2020
XhmikosR added a commit that referenced this pull request May 12, 2020
XhmikosR added a commit that referenced this pull request May 12, 2020
XhmikosR added a commit that referenced this pull request May 12, 2020
XhmikosR added a commit that referenced this pull request May 13, 2020
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants