Do you want to request a feature or report a bug?
Feature / Refactor
What is the current behavior?
This came up while working on #2494 and #2228.
In jest-config some options are validated in normalize.js and some are not. This results in many really lousy error messages when something is not right with the configuration.
What is the plan?
I've seen this as well, I think the main problem is that the CLI options are overwriting whatever is already normalized because they run after normalization, while the correct beaviour would be:
Parse configuration
Parse CLI (so CLI always override default config)
Normalize
How do you like them brand new config errors

and warnings?

wow this is beautiful. Can we extract this into a separate package so that other tools can use this for better errors? I want this everywhere.
Nit: "Option haste must be of type:"
Instead of "Valid example" I recommend just "Example" – I would assume the example is always valid.
Sure, I'd like to expose it as jest-config-validate, but first of all I want to get it working properly with Jest alone.
How about jest-validate?
Moving the discussion to related PR
Most helpful comment
wow this is beautiful. Can we extract this into a separate package so that other tools can use this for better errors? I want this everywhere.
Nit: "Option haste must be of type:"
Instead of "Valid example" I recommend just "Example" – I would assume the example is always valid.