ref(eslint): enable no-unsafe-arguments in scraps#115877
Conversation
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 66fd55b. Configure here.
📊 Type Coverage Diff
🔍 6 new type safety issues introducedType assertions (
This is informational only and does not block the PR. |
| ? value.map((val: OptionType['value'] | null | undefined) => | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
| flatOptions.find(option => compare(option.value, val)) | ||
| ) | ||
| : // eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
| flatOptions.find(opt => compare(opt.value, value)) || noMatchFallback; |
There was a problem hiding this comment.
instead of adding eslint comments here, what if we update the compare function?
const compare = (a: unknown, b: unknown) => {
if (props.isValueEqual && defined(a) && defined(b)) {
return props.isValueEqual(
a as OptionType['value'],
b as OptionType['value'],
);
}
return a === b;
};
There was a problem hiding this comment.
the problem is that opt.value is of type any because of some underlying types in react-select we can’t change :/ The eslint comment surfaces this, I think changing the input types to unkonwn with a type assertion might just lead to wrong things being passed in
priscilawebdev
left a comment
There was a problem hiding this comment.
left 1 suggestion, but it looks good to me
No description provided.