Skip to content

fix(postcss): preserve source prefixes before interpolations - #1506

Merged
Anber merged 2 commits into
masterfrom
anber/fix-interpolated-selector-dot
Aug 5, 2026
Merged

fix(postcss): preserve source prefixes before interpolations#1506
Anber merged 2 commits into
masterfrom
anber/fix-interpolated-selector-dot

Conversation

@Anber

@Anber Anber commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Motivation

stylelint --fix drops the leading dot from an interpolated class selector, changing .${className} into ${className} and silently turning a class selector into a type selector.

Closes #1501.

Summary

The parser now records whether it added a synthetic . or -- to keep each interpolation parseable. The stringifier removes a prefix only when it matches that parser metadata, preserving otherwise identical prefixes from the source.

Validation

  • 95 Jest tests and 13 snapshots
  • TypeScript typecheck
  • ESLint

@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e8b24c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@linaria/postcss-linaria Patch
@linaria/atomic Patch
@linaria/babel-plugin-interop Patch
@linaria/core Patch
@linaria/react Patch
@linaria/server Patch
@linaria/stylelint Patch
@linaria/stylelint-config-standard-linaria Patch
linaria Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Anber
Anber marked this pull request as ready for review August 5, 2026 09:58
@Anber
Anber merged commit 84f4cf5 into master Aug 5, 2026
8 checks passed
@Anber
Anber deleted the anber/fix-interpolated-selector-dot branch August 5, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@linaria/postcss-linaria: stylelint --fix drops the leading dot from an interpolated class selector

1 participant