Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 1.24 KB

File metadata and controls

79 lines (53 loc) · 1.24 KB

declaration-block-trailing-semicolon

Require or disallow a trailing semicolon within declaration blocks.

a { background: orange; color: pink; }
/**                                ↑
 *                    This semicolon */

The trailing semicolon is the last semicolon in a declaration block and it is optional.

此规则忽略:

  • Less mixins
  • trailing // comments
  • declaration blocks containing nested (at-)rules

命令行中的 --fix 选项可以自动修复此规则报告的所有问题。

选项

string: "always"|"never"

"always"

There must always be a trailing semicolon.

以下模式被视为违规:

a { color: pink }
a { background: orange; color: pink }
a { @include foo }

以下模式被视为违规:

a { color: pink; }
a { background: orange; color: pink; }
a { @include foo; }

"never"

There must never be a trailing semicolon.

以下模式被视为违规:

a { color: pink; }
a { background: orange; color: pink; }

以下模式被视为违规:

a { color: pink }
a { background: orange; color: pink }