schema-utils
schema-utils copied to clipboard
improve error reporting in some cases
- Operating System: any
- Node Version: any
- NPM Version: any
- webpack Version: any
- schema-utils Version: 2.0.0
Feature Proposal
Supports:
- better errors for
not
keyword, for example ({ "not": { "minimum": 3 } }
should outputshould not be < 3 | should be any non-number
) - improve message for objects like
object { key: string }
Feature Use Case
Better error reporting
@evilebottnawi I think it will be better, if you will describe what you mean in 2nd proposal
@vankop Now https://github.com/webpack/schema-utils/blob/master/test/snapshots/index.test.js.snap#L1544
Expected: object { foo?: boolean, bar?: integer }
(boolean
and integer
just example maybe in test should be other value).
Also printing objects now is very unreadable when we have a lot of properties, will be great break them in style:
object {
bar1,
bar2,
bar3,
bar4,
bar5,
bar6,
bar7
}
But it is other issue
i will take second one, if you did not start it =)
Feel free to send a PR :+1: