【发布时间】:2016-03-30 09:36:58
【问题描述】:
我在我的 .scss 文件上使用带有 stylelint 的 postcss-scss,我正在尝试弄清楚如何强制执行规则,以便我的所有变量在整个项目中都遵循相同的命名约定。
有没有办法为变量名指定格式或模式(即正则表达式)?我知道 https://github.com/davidtheclark/stylelint-selector-bem-pattern 用于选择器,但我找不到任何关于变量名的信息。
我正在考虑类似于https://github.com/sasstools/sass-lint/pull/257 的东西,但这将与 stylelint 规则兼容。
例如,我可能希望我的变量名始终为驼峰式,在这种情况下:
// this wouldn't be correct
$my-variable: #000;
// but this would be correct
$myVariable: #000;
【问题讨论】: