首页 > 解决方案 > 是否有防止块开头出现空行的规则?

问题描述

是否有获取以下内容的 stylelint 规则?

我已阅读文档,但找不到

/* bad */
a {

  color: pink;
}

/* good */
a {
  color: pink;
}

标签: stylelint

解决方案


这解决了我的问题

"declaration-empty-line-before": ["always", {
  "except": ["first-nested"],
  "ignore": ["after-comment", "after-declaration"]
}],

参考:https ://stylelint.io/user-guide/rules/declaration-empty-line-before/#first-nested


推荐阅读