fix leading newlines for nested rules + fix trailing newlines for empty rules - #2
Merged
Conversation
bartveneman
pushed a commit
that referenced
this pull request
Jul 19, 2026
…rser 0.17.0 The rebase picked up @projectwallace/css-parser 0.16.0 -> 0.17.0, which fixes the dotted-layer-name splitting bug (PARSER_ISSUES.md issue #1) that previously made the standalone `@layer name;` statement form fall back to the regex-based formatter. Removed that bypass now that LayerName.text/.name correctly include the full dotted name, and let it go through the same structured printing path as everything else. PARSER_ISSUES.md updated to reflect the fix; re-verified the remaining issues (#2, #3, #5, #6, #7) are still present in 0.17.0, so their workarounds are unchanged.
bartveneman
pushed a commit
that referenced
this pull request
Jul 19, 2026
… in css-parser 0.18.1 Bumped @projectwallace/css-parser 0.18.0 -> 0.18.1, which fixes three more PARSER_ISSUES.md entries: - @supports selector(...) (and other function-token conditions) used to return an empty array; it's now deep-parsed into a real selector list. print_prelude_function now special-cases `selector()` to print via format_selector_list instead of the declaration-parsing path used for style()/other conditions, since a selector list isn't a declaration. - The leading only/not media-query prefix used to be silently dropped from a query's children (though still present in the query's own .text). format-css's own regex-based workaround (ONLY_NOT_PREFIX_RE, extracting it from node.text and prepending it) is now removed, since only/not are real PreludeOperator children the existing generic dispatch already prints correctly - leaving the old workaround in place would have double-printed them ("only only screen") now that the upstream fix landed. Confirmed via differential testing against the previous commit that this would have been a real, silent regression. - The .d.ts child-union mismatches on AtrulePrelude/ContainerQuery/ FeatureRange are also fixed - no code change needed there, just removed from the docs. Only issue #1 (=> tokenized as two operators) and #2 (no comment-preservation hook) remain open in PARSER_ISSUES.md. Added test coverage for both fixed behaviors (only/not prefix round-tripping without duplication, @supports selector() printing as a selector list rather than going through declaration formatting).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1