0

Trying to use nesting rules via postcss, but getting warnings below. What rules I need to add in stylelint file to fix these warnings?

Here is the css:

.count-sec {
    height: 520px;

    & p {
      color:#fff;
      margin: 0;
    }
}

Warnings:

Expected a trailing semicolon (declaration-block-trailing-semicolon) [stylelint]
Expected newline before "}" of a multi-line block (block-closing-brace-newline-before) [stylelint]
FarazShuja
  • 2,287
  • 2
  • 23
  • 34
  • Are you sure that is the CSS responsible for the warnings? I can't reproduce this at https://stylelint.io/demo/ – jeddy3 Jul 11 '17 at 06:42
  • Looks like I have some bad rule configured in my stylelint but not sure. – FarazShuja Jul 11 '17 at 07:57
  • `Expected a trailing semicolon` says that last style in a block needs to have semicolon, too. In your example you always use semicolons (which is good). Are you sure this piece of css you provided in your post is where the error comes from? Errors should also display error origin place: exact line, column and file name. – kamyl Jul 12 '17 at 10:09

1 Answers1

1

Expected a trailing semicolon (declaration-block-trailing-semicolon) [stylelint]

You should change your rule declaration-block-trailing-semicolon become "always" (https://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon/)

Expected newline before "}" of a multi-line block (block-closing-brace-newline-before) [stylelint]

You should change your rule block-closing-brace-newline-before become "always" (https://stylelint.io/user-guide/rules/block-closing-brace-newline-before/)

Ha Huu Tin
  • 304
  • 4
  • 14