postcss / postcss-cli

CLI for postcss
Other
824 stars 93 forks source link

Fails silently when config not found #467

Open kkmuffme opened 6 months ago

kkmuffme commented 6 months ago

When the config file isn't found, it silently fails and does nothing: https://github.com/postcss/postcss-cli/commit/b5a0c4f99b682dcf4b7401a6a5ed6398ed2ce93d

Is there a specific reason why this error is ignored @RyanZim ?

Would you accept a PR that changes this behavior that if a config path is passed (but no config found), it will still throw an error?

RyanZim commented 6 months ago

It's ignored since a config file isn't required (e.g. you could pass plugins inline with -u). However, it would make sense to throw if the --config option is being used, but no config file is found; PR welcome. Fair warning, this will be a breaking change, which I'd prefer to bundle with other breaking upgrades, so it probably won't be released right away.