Skip to content

Conversation

@jmgasper
Copy link
Collaborator

@jmgasper jmgasper commented Nov 2, 2025

Lint

@jmgasper jmgasper requested a review from kkartunov as a code owner November 2, 2025 06:01
const onSubmit = useCallback(
(data: FormAddDefaultReviewer) => {
const requestBody = _.pickBy(data, _.identity)
const requestBody = _.omitBy(
Copy link

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)
Copy link

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)}
Copy link

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'
Copy link

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'.

@kkartunov kkartunov merged commit 7b8dfb2 into dev Nov 2, 2025
7 of 8 checks passed
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