-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
chore: add no-unsafe-optional-chaining as it became part of recommanded settings #15202
Conversation
@@ -124,7 +124,7 @@ export const Dropdown = forwardRef( | |||
return; | |||
} | |||
|
|||
const { width, height } = menuRef.current?.getBoundingClientRect(); |
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.
Its checked above, !menuRef.current
=> early return, the ?
not needed
const { inlineSize: elementWidth, blockSize: elementHeight } = | ||
entries[0].borderBoxSize?.[0]; | ||
const borderBoxSize = entries[0].borderBoxSize?.[0]; | ||
if (!borderBoxSize) { |
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 probably never happens, but I wasn't sure
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.
Can't tell from documentation :/ But in any case, it's not worse than previous code, which throws error if !borderBoxSize
6932fdd
to
6f7e37c
Compare
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.
LGTM
https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining became part of recommended settings
Prep, for #15144