schema-utils icon indicating copy to clipboard operation
schema-utils copied to clipboard

improve error reporting in some cases

Open alexander-akait opened this issue 5 years ago • 4 comments

  • 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 output should not be < 3 | should be any non-number)
  • improve message for objects like object { key: string }

Feature Use Case

Better error reporting

alexander-akait avatar Jul 16 '19 16:07 alexander-akait

@evilebottnawi I think it will be better, if you will describe what you mean in 2nd proposal

vankop avatar Sep 27 '19 19:09 vankop

@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

alexander-akait avatar Sep 27 '19 19:09 alexander-akait

i will take second one, if you did not start it =)

vankop avatar Sep 27 '19 19:09 vankop

Feel free to send a PR :+1:

alexander-akait avatar Sep 27 '19 19:09 alexander-akait