Skip to content

Warn on invalid @value definitions #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

cmrn
Copy link
Contributor

@cmrn cmrn commented Jun 4, 2025

Just noticed a flaw with my previous PR #56 - RegExp.prototype.exec will return null if no match is found. Previously this wouldn't cause an error since the while statement would skip if matches was null. Now it will throw a TypeError: object null is not iterable when destructuring the result.

This PR prevents this error, and instead emits a postcss warning if the @value statement couldn't be parsed. This matches the behavior of postcss-modules-values as described in this test.

@princed princed merged commit cac20c0 into princed:master Jun 5, 2025
2 checks passed
@princed
Copy link
Owner

princed commented Jun 5, 2025

Very thorough approach, thank you!
Out as 4.2.2

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