-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Remove redundant brackets #27768
Remove redundant brackets #27768
Conversation
I don't think there's a rule for this, right? In stylelint-scss. |
@XhmikosR, no there isn't at the moment. My gut feeling tells me that'll also be a hard one to implement. |
LGTM AFAIK, but let's wait to hear from @mdo too |
I'm fine to do either way here—having the parentheses helped me with readability and consistency across the project. Obviously a stylistic thing, so if folks don't want them, I'm fine with it. Would be also nice to have a linter for it though as @XhmikosR was suggesting. |
My main concern here is that if we can't automate the check, it's moot. And having the extra brackets is a personal choice. I'm not against it, except for the cases it makes the expression more clear, but unless we can automate it, we'll just have to keep an eye for it manually, which is something not reliable. |
We're actually quite inconsistent with this, for example these calculations don't use brackets: bootstrap/scss/_variables.scss Lines 296 to 301 in 0a55c7a
bootstrap/scss/_variables.scss Line 487 in 0a55c7a
bootstrap/scss/_button-group.scss Lines 70 to 71 in 0a55c7a
There are other things we always need to check ourself like the leading and trailing whitelines of titles in markdown files. I don't really like the idea that you can use whatever style you like here. Linting it would definitely be the best option, but I'm afraid this would be a plugin that is difficult to create, because you can have calc functions, scss variables, multiple value per property,... |
Let's go with it, just a 2-3 cases I think the brackets make it clearer. |
a7ea0a5
to
7ff2375
Compare
There are a lot of redundant brackets in the scss, this PR cleans this up a bit. I still left the brackets on some places if it increased the readability of the code like here:
bootstrap/scss/_popover.scss
Line 134 in e9ec5e7