Prettier: `@include` not respecting 80 columns

Created on 15 Jun 2017  Â·  1Comment  Â·  Source: prettier/prettier

It'd be preferable to break up long @include lines, I think...

.selector {
  @include absolute($top: $long-variable-name, $right: $long-variable-name, $left: auto, $bottom: auto);
}

should reformat too...

.selector {
  @include absolute(
    $top: $long-variable-name,
    $right: $long-variable-name,
    $left: auto,
    $bottom: auto
  );
}

I was planning on submitting a PR with a failing test, but I don't think I'll have time today so I just wanted to flag this. Thanks for everyone's work with this project so far. 😄


https://prettier.github.io/prettier/#%7B%22content%22%3A%22.selector%20%7B%5Cn%20%20%40include%20absolute(%24top%3A%20%24long-variable-name%2C%20%24right%3A%20%24long-variable-name%2C%20%24left%3A%20auto%2C%20%24bottom%3A%20auto)%3B%5Cn%7D%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22none%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22postcss%22%2C%22semi%22%3Atrue%2C%22useTabs%22%3Afalse%2C%22doc%22%3Afalse%7D%7D

csscsless locked-due-to-inactivity bug

Most helpful comment

Looks like we're not currently pretty-printing the content of the @include rule, it's just being printed as-is.

I experimented with using our value parser to parse it with some success, but had to do a couple of hacks just to make it work, so I won't be opening a pull request with these changes.

https://github.com/azz/prettier/commit/8398645b96eb1a7417e36419e09b822d062066a5#diff-64e0fbec5105a0d95768fb18e882472fR7

Maybe there's a more robust way of solving this.

>All comments

Looks like we're not currently pretty-printing the content of the @include rule, it's just being printed as-is.

I experimented with using our value parser to parse it with some success, but had to do a couple of hacks just to make it work, so I won't be opening a pull request with these changes.

https://github.com/azz/prettier/commit/8398645b96eb1a7417e36419e09b822d062066a5#diff-64e0fbec5105a0d95768fb18e882472fR7

Maybe there's a more robust way of solving this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarkKahn picture MarkKahn  Â·  3Comments

poteto picture poteto  Â·  3Comments

ikatyang picture ikatyang  Â·  3Comments

mafredri picture mafredri  Â·  3Comments

MrSaints picture MrSaints  Â·  3Comments