-
Notifications
You must be signed in to change notification settings - Fork 18
chore(components): review and update prop validation across component library #4891
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
base: main
Are you sure you want to change the base?
chore(components): review and update prop validation across component library #4891
Conversation
🦋 Changeset detectedLatest commit: 3f61906 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Related Previews |
packages/components/src/components/post-breadcrumb/post-breadcrumb.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/post-card-control/post-card-control.tsx
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to split the PR into smaller chunks?
Reviewing it is a little complex at the moment and I am not sure all changes are wanted.
item.setAttribute('heading-level', String(newValue)); | ||
}); | ||
validateHeadingLevel() { | ||
if (!checkNonEmpty(this, 'headingLevel')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a convention for functions that return a boolean: https://dev.to/michi/tips-on-naming-boolean-variables-cleaner-code-35ig Can you try and apply it here?
Otherwise would you be able to know if the property is required or not by inspecting the this
? If so the check empty/non empty could be done automatically in the checkers and not manually in the components.
this, | ||
'headingLevel', | ||
HEADING_LEVELS, | ||
'The `heading-level` property of the `post-accordion` must be a number between 1 and 6.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this custom message necessary? The goal of this PR would be to remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should probably not be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that change really part of your PR?
PR Changes