Skip to content

Conversation

@romainmenke
Copy link
Contributor

This is a follow up to : #1980

When testing PostCSS v8.4.48 I got some unexpected errors in Stylelint using the postcss-sugarss custom syntax.

It seems that this syntax doesn't expose source.offset

To avoid unexpected issues in the community I think it is best to add a fallback where we calculate the correct offset if this field is not set by the parser.
This is slower than directly accessing a pre-computed value but that makes PostCSS more resilient.

(Ideally postcss/sugarss#105 is resolved so that they also have the faster code when linting.)

@romainmenke romainmenke changed the title Fix position calculations when offst is missing Fix position calculations when offset is missing Nov 11, 2024
@romainmenke romainmenke changed the title Fix position calculations when offset is missing Fix position calculations when offset is missing Nov 11, 2024
@romainmenke romainmenke force-pushed the fix-position-calculations-when-offset-is-missing--inventive-panther-8b8cb3c2cf branch from cd98ca9 to 1f7be7f Compare November 11, 2024 17:43
@ai ai merged commit 3450630 into postcss:main Nov 11, 2024
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.

2 participants