-
Notifications
You must be signed in to change notification settings - Fork 9
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
Export regexes as the rules to reuse by other tools #35
Comments
Hi Kha! What are actually trying to do? 😄 |
Well, you may know that in my project (and you still remember what is that project, right?), we have a stylelint plugin to block people from using some CSS properties and transform properties. To do that, I have to parse the CSS in a specific way, which then along with #33 will boost the processing speed further. Which mean that I should reuse the regexes. Currently, I just copy them into my internal plugin, but I wonder if you could expose those regexes from your plugin? |
Oh I see. To be honest I'm not sure if exposing such implementation details is a good idea as I wouldn't like to provide any compatibility guarantees for them. Also I should say I copied most of them myself from https://github.com/css-modules/postcss-modules-values/blob/master/src/index.js#L5-L7 To sum up I think it'd be better to copy them over just as you did already. If it helps in any way, this plugin also provides a list of extracted values via postcss messages — https://github.com/princed/postcss-modules-values-replace#extracting-values-for-programmatic-use. |
Fair point. Then I just keep the copied one. Thanks anyway. |
Hi, me again.
Can we expose these regexes?
postcss-modules-values-replace/index.js
Lines 9 to 12 in 5627d68
I think it will be helpful if other tools could reuse those patterns of
@value
for their purpose (for example validating postcss rules, or preprocess the file before this values-replace plugin).The text was updated successfully, but these errors were encountered: