Environment
@linaria/postcss-linaria: 8.1.1
- Stylelint: 17.14.1
- PostCSS: 8.5.23
- Node.js: 24.16.0
- OS: macOS
Description
stylelint --fix inserts whitespace before a comment that trails a declaration on the same line. The amount added equals the indentation of the tagged template, and it is added again on every run:
color: red; /* c */ → color: red; /* c */ → color: red; /* c */
This reproduces with zero Stylelint rules configured, so the change happens during the parse/stringify round trip. A template that starts at column 0 is not affected.
Reproduction
.stylelintrc.mjs:
export default {
customSyntax: '@linaria/postcss-linaria',
rules: {},
};
sample.style.ts — the template is indented by 2:
import { css } from '@linaria/core';
export const style = {
a: css`
color: red; /* c */
`,
};
Run:
stylelint --config .stylelintrc.mjs --fix sample.style.ts
Expected:
Actual, two spaces added per run:
Environment
@linaria/postcss-linaria: 8.1.1Description
stylelint --fixinserts whitespace before a comment that trails a declaration on the same line. The amount added equals the indentation of the tagged template, and it is added again on every run:This reproduces with zero Stylelint rules configured, so the change happens during the parse/stringify round trip. A template that starts at column 0 is not affected.
Reproduction
.stylelintrc.mjs:sample.style.ts— the template is indented by 2:Run:
Expected:
Actual, two spaces added per run: