-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/NEWCLICKUI-4391 add new rule #4
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
base: master
Are you sure you want to change the base?
Conversation
@@ -12,6 +12,7 @@ const RULE_USE_MIXINS = 'stylelint-core-vars/use-mixins'; | |||
const RULE_USE_ONE_OF_MIXINS = 'stylelint-core-vars/use-one-of-mixins'; | |||
const RULE_DO_NOT_USE_DARK_COLORS = 'stylelint-core-vars/do-not-use-dark-colors'; | |||
const RULE_DO_NOT_USE_OLD_VARS = 'stylelint-core-vars/do-not-use-old-vars'; | |||
const RULE_NO_USELESS_VARS_IMPORT = 'stylelint-core-vars/no-useless-vars-import'; |
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.
А оно точно везде useless?
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.
В контексте названия имеешь ввиду? Там где срабатывает - да, а где vars импорят совместно с миксинами, правило же как раз и не будет ругаться. Или на что-то лучше заменить?
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.
Я про то что во всех ли проектах компании это так, библиотека же глобальная
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.
@reme3d2y @SiebenSieben Привет!
Подскажите пожалуйста, ок ли вам по такому правилу?
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.
Нам бы обновить кодоунеров, reme3d2y уже с нами не работает, и я по факту не занимаюсь поддержкой линтера
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.
По вопросу не уверен, что везде будет ок, предлагаю спросить в рокетчате javascript
@@ -174,6 +180,46 @@ const checkDarkColorsUsage = (decl, result, context, ruleName) => { | |||
} | |||
}; | |||
|
|||
const checkVarsImportUsage = (root, result, context, ruleName) => { | |||
const isVarsCssImport = (params) => /\/?vars\.css(['"])?\s*;?$/.test(params); |
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.
Может стоит ограничить конкретным местом? Какая мотивация ограничения для всех vars.css
?
Добавлено правило, которое запрещает импорт vars.css в проектах.
Учтено использование вместе с
@mixin / @include
.checkDarkColorsUsage() - убраны неиспользуемые параметры.
Мотивация и контекст
Выполнено в рамках задачи - NEWCLICKUI-4391 "Нужно запретить импорт @import '../../vars.css' в css-модулях".
Для модулей, в которых есть миксины, импорт разрешаем