-
Notifications
You must be signed in to change notification settings - Fork 21
Lint fixes #1289
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
Lint fixes #1289
Conversation
| const onSubmit = useCallback( | ||
| (data: FormAddDefaultReviewer) => { | ||
| const requestBody = _.pickBy(data, _.identity) | ||
| const requestBody = _.omitBy( |
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.
[❗❗ correctness]
Switching from _.pickBy to _.omitBy changes the logic to exclude certain values. Ensure that excluding empty strings, null, and undefined is intended and does not affect required fields or default values.
| }: BasicSelectProps = props | ||
|
|
||
| const normalizedValue = value === null || value === undefined ? '' : value | ||
| const normalizedValue = value === null || value === undefined ? '' : String(value) |
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.
[correctness]
Converting value to a string using String(value) may lead to unexpected results if value is an object or a symbol. Consider ensuring value is always a primitive type before this conversion.
| <option | ||
| key={`${option.value ?? option.label ?? index}-${index}`} | ||
| value={`${option.value ?? ''}`} | ||
| key={String(option.value ?? option.label)} |
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.
[❗❗ correctness]
Using String(option.value ?? option.label) as a key may lead to duplicate keys if option.value or option.label are not unique. Ensure that each option has a unique key to prevent rendering issues.
| `${value?.toLowerCase()}${ | ||
| value === 'SCALE' | ||
| mapValue: (value: string | number | boolean | '') => { | ||
| const stringValue = typeof value === 'string' |
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.
[correctness]
The mapValue function now handles value as string | number | boolean | ''. Ensure that String(value ?? '') correctly handles all expected cases, especially for boolean values, as this could lead to unexpected string representations like 'true' or 'false'.
Lint