Modify rule S6606: Mention TSConfig's strictNullChecks requirement (#1796)

This commit is contained in:
Yassin Kammoun 2023-04-24 12:34:16 +02:00 committed by GitHub
parent b78e301311
commit 930ac77273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,8 @@ The nullish coalescing operator `??` allows providing a default value when deali
This rule reports when disjunctions (`||`) and conditionals (`?`) can be safely replaced with coalescing (`??`).
The TSConfig needs to set `strictNullChecks` to `true` for the rule to work properly.
== How to fix it
Rewrite the logical expression `||` using `??` on the unchecked operands.