Skip to content

Fix missing offset in Node#positionInside, Node#positionBy and Node#rangeBy#2033

Merged
ai merged 8 commits into
postcss:mainfrom
mizdra:fix-missing-offset
Mar 22, 2025
Merged

Fix missing offset in Node#positionInside, Node#positionBy and Node#rangeBy#2033
ai merged 8 commits into
postcss:mainfrom
mizdra:fix-missing-offset

Conversation

@mizdra

@mizdra mizdra commented Mar 22, 2025

Copy link
Copy Markdown
Contributor

fix: #2029
base on: #2031

@mizdra
mizdra force-pushed the fix-missing-offset branch from 1778f8a to b5aa0cb Compare March 22, 2025 12:15
@mizdra
mizdra marked this pull request as ready for review March 22, 2025 12:15
@mizdra
mizdra marked this pull request as draft March 22, 2025 12:16
Comment thread lib/node.d.ts
@mizdra
mizdra marked this pull request as ready for review March 22, 2025 12:20
@ai

ai commented Mar 22, 2025

Copy link
Copy Markdown
Member

CI is still falling. Maybe it is an issue after the merge? Can you look?

@mizdra

mizdra commented Mar 22, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing! I fixed the conflict resolution mistakes.

@ai
ai merged commit 7892a29 into postcss:main Mar 22, 2025
@mizdra
mizdra deleted the fix-missing-offset branch March 23, 2025 04:04
ai pushed a commit that referenced this pull request Jun 27, 2026
positionBy()'s default branch returned this.source.start verbatim, so for
custom syntaxes whose source.start lacks an offset (e.g. postcss-html) it
returned a position without offset, violating the Position type which
declares offset as required. rangeBy()/positionInside() were normalized to
always compute offset via sourceOffset() (#2033, issue #2029) but
positionBy() was left behind. Mirror the rangeBy() pattern.

Co-authored-by: oss69U-prep <prep@local>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

Missing offset property of Node.Position in some cases

2 participants