Skip to content

feat: format object properties with types#59

Open
vankop wants to merge 7 commits into
webpack:mainfrom
vankop:more-info-for-object-properties
Open

feat: format object properties with types#59
vankop wants to merge 7 commits into
webpack:mainfrom
vankop:more-info-for-object-properties

Conversation

@vankop

@vankop vankop commented Sep 28, 2019

Copy link
Copy Markdown
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

#42
2nd proposal

Breaking Changes

no

Additional Info

Looks like for array and object we can skip formatting type.

@codecov

codecov Bot commented Sep 28, 2019

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.13%. Comparing base (62fb107) to head (db7e4f6).
⚠️ Report is 128 commits behind head on main.

Files with missing lines Patch % Lines
src/ValidationError.js 97.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
- Coverage   98.72%   98.13%   -0.59%     
==========================================
  Files           5        5              
  Lines         550      645      +95     
  Branches      250      268      +18     
==========================================
+ Hits          543      633      +90     
- Misses          7       12       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add test for multiple types, output should be like <key>: string | integer.

For objects we don't expand them, right?

@vankop

vankop commented Sep 28, 2019

Copy link
Copy Markdown
Contributor Author

Yes objects and arrays are not expanded

@vankop

vankop commented Sep 28, 2019

Copy link
Copy Markdown
Contributor Author

Multiple types could be only with anyOf | oneOf. Here we just look on type if it exists

@vankop

vankop commented Sep 28, 2019

Copy link
Copy Markdown
Contributor Author

so @evilebottnawi what we need in this PR still? Tests on additionalProperties ?

@alexander-akait

alexander-akait commented Sep 28, 2019

Copy link
Copy Markdown
Member

@vankop all is good, i will review deeply this in near future

@alexander-akait

Copy link
Copy Markdown
Member

/cc @vankop need rebase, also i think we should improve output using \n (like prettier do with objects 😄 ), because some error is very long

@vankop

vankop commented Nov 11, 2019

Copy link
Copy Markdown
Contributor Author

also i think we should improve output using \n

@evilebottnawi you have any ideas how to do it better?

When I did this I was thinking about it, but did not realized how to do it better, since it depends totally on terminal window size + font type/size. Approach when we rely only on amount of properties also fails because of glyph sizes

@alexander-akait

alexander-akait commented Nov 12, 2019

Copy link
Copy Markdown
Member

@vankop the good question, maybe we can solve this in other PR, i think packages like table have algorithm for this, need look on them logic

@vankop

vankop commented Nov 26, 2019

Copy link
Copy Markdown
Contributor Author

/cc @evilebottnawi

Ready to review

maybe we can solve this in other PR, i think packages like table have algorithm for this, need look on them logic

I think this really important, I will take a look in table package, thanks for suggestion

@vankop

vankop commented Nov 26, 2019

Copy link
Copy Markdown
Contributor Author

Also interesting question is - do we need sort properties alphabetically?

@alexander-akait

Copy link
Copy Markdown
Member

@vankop it is very old 😄 what we will do with it? close or rebase? 😄

@vankop

vankop commented Apr 15, 2023

Copy link
Copy Markdown
Contributor Author

I could merge main to make this relevant again

@alexander-akait

Copy link
Copy Markdown
Member

@vankop Yeah, let's do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants