1

Which configuration settings are required to get this output:

.namespace {
   .title {}

   .item {}
}

I found a configuration for the empty line between the blocks, but nothing about preventing the last empty line in a nested block.

.namespace {
   .title {}
   --- rule-nested-empty-line-before ---
   .item {}
   --- But this empty line should throw a warning ---
}
4

1 回答 1

2

block-closing-brace-empty-line-before规则已添加到stylelint@7.1. 您可以使用此规则在块的右大括号之前禁止或允许空行。

由于您希望禁止空行,您应该使用"never"主要选项,例如

"block-closing-brace-empty-line-before": "never"

这将强制执行以下代码样式:

.namespace {
  .item {}
}
于 2016-08-03T07:43:10.313 回答