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: improving code safety with nullish coalescing operator #2823

Conversation

csouchet
Copy link
Member

Resolved the error reported by plugin:@typescript-eslint/stylistic-type-checked rules by replacing the logical OR (||) operator with the nullish coalescing operator (??).
This change contributes to safer and more predictable code behavior, aligning with the recommendations of @typescript-eslint/prefer-nullish-coalescing.

@csouchet csouchet added the refactoring Code refactoring label Aug 25, 2023
@github-actions
Copy link

github-actions bot commented Aug 25, 2023

♻️ PR Preview 031e096 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

♻️ PR Preview 031e096 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@csouchet csouchet force-pushed the use_nullish_coalescing_operator_instead_of_a_logical_or_(`||`) branch 2 times, most recently from 2f581d6 to 4731856 Compare August 28, 2023 09:55
…stead of a logical or (`||`), as it is a safer operator @typescript-eslint/prefer-nullish-coalescing
@csouchet csouchet force-pushed the use_nullish_coalescing_operator_instead_of_a_logical_or_(`||`) branch from 4731856 to 031e096 Compare August 28, 2023 11:26
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@csouchet csouchet marked this pull request as ready for review August 28, 2023 11:36
@csouchet csouchet requested a review from tbouffard August 28, 2023 11:36
Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

LGTM. Good job!

@tbouffard tbouffard merged commit 9d33d8d into master Aug 28, 2023
@tbouffard tbouffard deleted the use_nullish_coalescing_operator_instead_of_a_logical_or_(`||`) branch August 28, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants