-
-
Notifications
You must be signed in to change notification settings - Fork 209
Ehzhang/error on warnings #399
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
Conversation
2 similar comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure it is good idea, we need implement result.errors() (if it is available in postcss) or add property error to warning and use emitError for this case
|
Is it the implementation that isn't a good idea, or the addition of this config value? I'm not sure what you mean by implementing |
|
@ehzhang it is good practice emit warnings as warnings and errors as errors (all loaders and plugins do it), maybe good idea create issue/PR in webpack and implement this feature in core, not in loaders/plugins (otherwise we need implement this option in all loaders/plugins and it is not good) |
|
Sounds reasonable - kind of the response that I would've expected. I did notice that not many loaders do this (maybe the only exception would be one like ts-loader, that allows setting error levels). I'll close this - thanks for taking the time to look it over! |
Notable Changes
👋
This adds an
emitWarningsAsErrorsoption to the postcss-loader config, which would (as the name suggests) emit warnings coming from postcss plugins as errors.We're interested enforce issues coming as warnings to our build pipelines (and development workflows) and fail. For example, we might have typos in imported variable names
var(--foobar), which get emitted as warnings and kind of hidden amongst the webpack output. We'd like to be extra strict for our css warnings 😬An alternative on our end might be to check
stats.warningsourselves, but it would be nice to not have to filter through all other warnings that might not be coming from postcss-loader. Very welcome to feedback/discussion for this - would like to know what you might prefer/if this makes sense as a configuration option on this loader.Thanks in general for maintaining this library :)
Commit Message Summary (CHANGELOG)emitWarningsAsErrorsflag to emit plugin warnings as errorsType
Issues
#1SemVer
Checklist