-
Notifications
You must be signed in to change notification settings - Fork 468
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
SelectorFormat refuses valid BEM #254
Comments
Well yeah it's |
@Anahkiasen seems not. According to https://bem.info/method/definitions/
According to http://xslc.org/jquery-bem/
And even if you look at http://yandex.ru
|
@Anahkiasen actially am pretty sure all of these should pass .b-block__element-name_modifier {
border: 1px solid;
}
.b-block__element-name_modifier_value {
border: 1px solid;
}
.b-block__element-name_modifier-name_value {
border: 1px solid;
}
.b-block__element-name_modifier-name_value-long {
border: 1px solid;
} this regex does the job it seems:
|
Yes, @mrpavlikov, I believe that throughout SCSS-Lint what's referred to as "BEM" is a modified version that has become more popular than the original, it seems -- which distinguishes modifiers with |
Yes indeed I use the variant Harry Roberts popularised, never really encountered the "original" one, always saw this one being used. |
It is simple enough to add another convention to the list, but it's unfortunate that this particular convention does not seem to be standardized despite its relatively distinct name. If people are fine with a If there is significant debate over which convention deserves the pure title of |
@sds well, BEM has been developed by Yandex, so I'd rather stick to their syntax. Also, according to official bem docs: http://bem.info/method/definitions/ (look at Element modifiers) it's single underscores. Btw, this doc says
So this is not valid .b-block__element-name_modifier {
border: 1px solid;
} and this is valid .b-block__element-name_modifier_value {
border: 1px solid;
} so regex should look something like:
|
@sds even tho Actually I'm perfectly fine with both ways (keep current BEM rule as is or rewrite to strict one). |
I'm comfortable changing the default @mrpavlikov I took your regex as-is in 308b084. Would be great if you could take it for a spin (or submit a PR with tests), as I'm a little strapped for time, and this isn't a feature I would use myself. Thanks! |
New SelectorFormat linter refuses valid BEM selectors (modifications on elements):
Saying:
Am forced to use custom regular expression for this, would prefer to use built-in feature.
The text was updated successfully, but these errors were encountered: