Closed jonathanglasmeyer closed 5 years ago
I think that the lib itself should not throw errors and for CI the cli should be used. Some Build mechanisms don't care about errors but exit codes. But I might be wrong...
I guess @jonathanewerner is suggesting to process.exit(1)
on errors along with logging, if desired by passing throwErrors: true
as config.
I think I should not coment before I had my first cup of coffee... That's totally valid. If it's ok I'll implement this behavior when my changes to configuration-validator are done.
Morning. Same timezone here, first coffee coming. :) :coffee:
@sarbbottam that's exactly what I'm suggesting.
I think it's an orthogonal question if the user wants to use a cli tool for that for that or if they want to wrap their config object with our validate function. Both approaches should allow throwing errors. (cli: --throw-errors
, programmatic: {throwErrors: true}
).
@nyrosmith: Do it. :+1:
@nyrosmith would you like to assign yourself to this issue?
Done
It's on hold until the new configuration-validator API is done.
Right now we are only console.logging warnings. For CI build processes it would be beneficial if the user could opt in to have webpack-validator throw errors on problems. This way cryptic errors from webpack malconfiguration would be replaced with DX-friendlier errors in CI logs.
The could be implemented by supplying a 'throwErrors': true configuration option to either the CLI interface or to our default export validate function.
Thoughts?