anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

onFeatureUsage callback vs. PostCSS result.warn #24

Closed sebastienbarre closed 8 years ago

sebastienbarre commented 8 years ago

I was wondering about the rational behind using the onFeatureUsage callback in the PostCSS plugin? Wouldn't PostCSS's result.warn() API make more sense? In that way warnings would flow through PostCSS, and could potentially be pretty-printed by postcss-reporter. Alternatively, maybe both could be used? Thank you. (I can work on a PR if needed)

sebastienbarre commented 8 years ago

With respect to the PostCSS plugin, what about this: if the onFeatureUsage callback is not set, then we use PostCSS's result.warn to send the warning message (which in turn can be intercepted and pretty-printed by postcss-reporter). This doesn't break any API, and people can still silence doiuse by providing an empty callback (then again, I'm not sure why you wouldn't want to see the warnings). I can push a PR along these lines.

anandthakker commented 8 years ago

Closed by #26