postcss / postcss-calc

PostCSS plugin to reduce calc()
MIT License
215 stars 33 forks source link

feat: avoid fatal error #137

Closed alexander-akait closed 2 years ago

alexander-akait commented 3 years ago

/cc @ludofischer @Semigradsky

The main idea is avoid fatal error when we can't parse and keep value as it, should we use warning or error? Should we have options to change warning on error and versa vice.

ludofischer commented 3 years ago

The main idea is avoid fatal error when we can't parse and keep value as it, should we use warning or error? Should we have options to change warning on error and versa vice.

In the context of cssnano I think it should be a warning, if the code reaches minification we assume the CSS is already tested and validated. There's already a way to turn PostCSS warnings into errors, and I don't think adding the option to one plugin at a time is a common use case (why would you want to only error when there are calc() warnings but not on other warnings?)

alexander-akait commented 3 years ago

why would you want to only error when there are calc() warnings but not on other warnings?

Because here he handle only calc :smile:

Right now many developers get fatal errors due this using cssnano, we should fix it

ludofischer commented 3 years ago

I think this is fine, people can use a linter to prevent them from writing invalid CSS.

alexander-akait commented 3 years ago

@ludofischer anyway we should use postcss API for errors, no just throw an error

ludofischer commented 3 years ago

@ludofischer anyway we should use postcss API for errors, no just throw an error

Yes, this should solve https://github.com/cssnano/cssnano/issues/910

ludofischer commented 2 years ago

Is this ready? I've received permissions on this repository so I could merge it.

alexander-akait commented 2 years ago

Ready, just want to ensure you review my changes

ludofischer commented 2 years ago

Looks fine, we can fix the quote formatting in a different PR as right now it's inconsistent throughout the code base.

alexander-akait commented 2 years ago

do you have access for publish?

ludofischer commented 2 years ago

do you have access for publish?

No.

alexander-akait commented 2 years ago

@ludofischer Sorry for delay, added permission for postcss-calc, now you can publish