Repository navigation
fix: correctly print atrule preludes without regexes - #255
Draft
bartveneman wants to merge 4 commits into
Draft
bartveneman wants to merge 4 commits into
bartveneman wants to merge 4 commits into
Conversation
Contributor
|
| 📦 Package | 📏 Base Size | 📏 Source Size | 📈 Size Change |
|---|---|---|---|
| @projectwallace/format-css | 9.3 kB | 10.6 kB | +1.3 kB |
This was referenced Oct 21, 2026
bartveneman
added a commit
that referenced
this pull request
Oct 21, 2026
## Summary
- Bumps `@projectwallace/css-parser` from `^0.18.12` to `^0.19.0`
(`package.json` and `pnpm-lock.yaml`).
- 0.19.0 changes the argument order of the string helpers:
`str_index_of` and `str_starts_with` now take the lowercase needle
first, like `str_equals`. TypeScript can't flag this because both
signatures are `(string, string)`.
- The only affected call site on `main` is `str_index_of(prelude,
'selector(')` in `format_atrule_prelude`, now `str_index_of('selector(',
prelude)`. The `str_equals` calls already used this order.
- Split out of #255 to keep that PR focused; #255 builds on this change.
## Test plan
- [x] `vitest run` passes (277 passed, 1 skipped)
- [x] `tsc` clean
- [x] `oxlint` / `oxfmt --check` clean
---
---
_Generated by [Claude
Code](https://claude.ai/code/session_01KUTjbYYHYCyZ6FTyXrqGHX)_
Co-authored-by: Claude <noreply@anthropic.com>
Print @media, @container, @supports, @layer, @scope and @import preludes from the parsed AST instead of regex replacements. Preludes that are not conditions (@page, @namespace, @document, @custom-selector, @function, @font-feature-values) are only whitespace- and comma-normalized, keeping strings, urls, colons and type tokens intact. Selectors in @scope are formatted. Adds extensive at-rule tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bartveneman
force-pushed
the
claude/eloquent-tesla-um0olt
branch
from
October 21, 2026 19:14
0584cf7 to
4acaef9
Compare
Test-drives css-parser@22acfdc (pkg.pr.new preview), where PreludeSelectorList has a parsed SelectorList child. Drops the re-parse of node.value. Switch the dependency to the released version before merging.
bartveneman
marked this pull request as draft
October 21, 2026 19:22
@namespace now prints from its parsed children. Preludes the parser only gives us as Raw (@page, @document, @custom-selector, @function, @font-feature-values) are walked token by token, which keeps strings intact without placeholder regexes.
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 #230