Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forms): improve field error method type defs #16524

Merged
merged 1 commit into from
May 11, 2019
Merged

fix(forms): improve field error method type defs #16524

merged 1 commit into from
May 11, 2019

Conversation

vicrep
Copy link
Contributor

@vicrep vicrep commented May 10, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

👻 What's the background?

getFieldError and getFieldsError's return types are too restrictive, forcing consumers to cast the methods when using them.

💡 Solution

Change getFieldError and getFieldsError to return actual types, instead of very restrictive Object type (which should be avoided in general, in favour of unknown, object, or Record depending on actual use).

📝 Changelog

  • English Changelog: improve return type of form field error getters
  • Chinese Changelog (optional): ?

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Change `getFieldError` and `getFieldsError` to return actual types, instead of very restrictive `Object` type (which should be avoided in general, in favour of `unknown`, `object`, or `Record` depending on actual use).
@netlify
Copy link

netlify bot commented May 10, 2019

Deploy preview for ant-design ready!

Built with commit 6119095

https://deploy-preview-16524--ant-design.netlify.com

@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #16524 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16524   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         258      258           
  Lines        7120     7120           
  Branches     1970     1970           
=======================================
  Hits         6815     6815           
  Misses        303      303           
  Partials        2        2
Impacted Files Coverage Δ
components/form/Form.tsx 91.3% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eacfd7...6119095. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #16524 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16524   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         258      258           
  Lines        7120     7120           
  Branches     1970     1970           
=======================================
  Hits         6815     6815           
  Misses        303      303           
  Partials        2        2
Impacted Files Coverage Δ
components/form/Form.tsx 91.3% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eacfd7...6119095. Read the comment docs.

@afc163 afc163 merged commit b3e90d7 into ant-design:master May 11, 2019
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.

2 participants