43081j/postcss-lit

Indentation should account for template position

43081j opened this issue · 0 comments

For example:

const style = css`
  .foo { color: hotpink; }
`;

stylelint will complain about this, because it thinks it should be indented one less:

const style = css`
.foo { color: hotpink; }
`;

i'd argue the former is perfectly fine and more readable. so we should probably de-indent when parsing, relative to the template's indentation level

we can use the template's end position as a base and de-indent everything by that amount.

@abdonrd FYI, this might affect you too. when i publish whats in master, it'll now work for you but i think you'll get a bunch of indentation warnings like i do, until this issue is fixed