-
Notifications
You must be signed in to change notification settings - Fork 1
allowTag option and pseudoclass fix #1
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
Conversation
48a0a38 to
e7c4632
Compare
|
Мне в целом Есть еще один мажорный вариант: переименовать @dima117 что думаешь? |
eGavr
left a comment
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.
А еще у тебя там есть баг, о котором мы лично поговорили)
lib/index.js
Outdated
|
|
||
| var validator = new CssNaming(config._config.excludeClasses, addError); | ||
| var validator = new CssNaming({ | ||
| excludes: config._config.excludeClasses, allowTag: config._config.allowTag |
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.
обращение к private полю, надо звать config.getConfig()
lib/css-naming.js
Outdated
| selector.eachClass(function(cssClass) { | ||
| hasTargetBlock |= _this._validateClass(cssClass, blockName, rule); | ||
| selector.walk(function(node) { | ||
| node.type === 'class' && (hasTargetBlock |= _this._validateClass(node, blockName, rule)); |
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.
а какой смысл от приведения? почему не хранить в hasTargetBlock булевые значения?
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.
для случаев составного селектора как я понимаю:
.not-taget .target {}
|
кмк, в строгом случае наличие селекторов на тег — это баг с точки зрения методологии, так что отключать нужно именно по опции |
|
@eGavr ping? |
|
Мы не вольем всё равно без /ok-а @dima117 Дима, посмотришь? мне в целом /ok |
dima117
left a comment
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.
Не можем влить эти изменения, т.к. в плагин добавлена логика, не входящая в его зону ответственности + она реализована не до конца. Если нужно, чтобы проверка наличия класса блока в селекторе не выполнялась, лучше отключить её явно, а не добавлять логику, заменяющую ее.
Посмотрите PR про возможность выборочного отключения правил валидации
postcss and selector-parser were updated.
allowTag option was added and behaviour with pseudoclass was fixed