Skip to content
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

refactor: use strict equals #1936

Closed
wants to merge 1 commit into from
Closed

refactor: use strict equals #1936

wants to merge 1 commit into from

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Mar 14, 2024

No description provided.

Copy link
Contributor

@brunnerh brunnerh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine, but their validity was non-trivial to check without IDE support on the various variable and function types.

Overall value of this change seems a bit questionable.

@@ -67,7 +67,7 @@
if (selectorPrimaryFocus == null) return;
const node =
(element || innerModal)?.querySelector(selectorPrimaryFocus) || buttonRef;
if (node != null) node.focus();
if (node !== null) node.focus();
Copy link
Contributor

@brunnerh brunnerh Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line above already has some optional chaining, could be used here as well.

Suggested change
if (node !== null) node.focus();
node?.focus();

(Also, regarding the line above, || should not be abused, the correct operator would be ??)

@metonym metonym marked this pull request as draft April 21, 2024 21:41
@metonym metonym closed this Apr 21, 2024
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.

2 participants