-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fork number-field and text-field templates #2495
base: main
Are you sure you want to change the base?
Conversation
if (props) { | ||
// eslint-disable-next-line guard-for-in | ||
for (const key in props) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any | ||
(element as any)[key] = (props as any)[key].toString(); | ||
} | ||
} |
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.
Note: This function broke quite a few lint rules we have in place for nimble. I chose to mostly disable those rules and keep the original code rather than completely re-write this function. Let me know if you think it would be better to find a different way to write this code.
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.
If you have ideas on another way to write it without disabling the lint rules, it's probably worth doing so (I think we try to fix 'small' lint issues rather than suppress, when we bring FAST tests over).
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.
I fixed one of the lint rules, but the collection of issues around assigning an arbitrary property from props
to element
seems much more challenging to fix (at least without jumping through a bunch of typing hoops).
@msmithNI, will you buddy this PR for me? |
if (props) { | ||
// eslint-disable-next-line guard-for-in | ||
for (const key in props) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any | ||
(element as any)[key] = (props as any)[key].toString(); | ||
} | ||
} |
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.
If you have ideas on another way to write it without disabling the lint rules, it's probably worth doing so (I think we try to fix 'small' lint issues rather than suppress, when we bring FAST tests over).
Pull Request
π€¨ Rationale
Fork the FAST templates for the number-field and the text-field in preparation for adding a required-visible icon to the label (see #2100)
π©βπ» Implementation
Forked the FAST templates for the number-field and the text-field with no functional changes.
π§ͺ Testing
Verified tests still pass and no visual changes were introduced to those components.
β Checklist