matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Adds empty line before src in font-face declaration #203

Open gajus opened 8 years ago

gajus commented 8 years ago

I am using stylelint-config-standard.

Given the following CSS:

@font-face {
  font-family: 'graphik-webfont';
  font-weight: 400;
  font-style: normal;
  src: url('./fonts/graphik-regular.eot');
  src: url('./fonts/graphik-regular.eot?#iefix') format('embedded-opentype'), url('./fonts/graphik-regular.woff2') format('woff2'), url('./fonts/graphik-regular.woff') format('woff');
}

stylefmt converts it to:

@font-face {
  font-family: 'graphik-webfont';
  font-weight: 400;
  font-style: normal;

  src: url('./fonts/graphik-regular.eot');
  src: url('./fonts/graphik-regular.eot?#iefix') format('embedded-opentype'), url('./fonts/graphik-regular.woff2') format('woff2'), url('./fonts/graphik-regular.woff') format('woff');
}

which then causes an error in stylelint:

src/client/containers/BlogContainer/static/styles.css
  6:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before
 15:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before
 24:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before
 33:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before
 42:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before
 51:3  ✖  Unexpected empty line before declaration                     declaration-empty-line-before