Skip to content

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

Merged
XhmikosR merged 2 commits intomasterfrom
master-xmr-regex-test
Jan 7, 2020
Merged

Use regex.test() when we want to check for a Boolean.#29969
XhmikosR merged 2 commits intomasterfrom
master-xmr-regex-test

Conversation

@XhmikosR
Copy link
Copy Markdown
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
Comment thread js/src/tooltip.js
if (tabClass !== null && tabClass.length) {
tabClass
.map(token => token.trim())
if (tabClass !== null && tabClass.length > 0) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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