Use ?. where it represents the intended semantics (#11512)
This commit is contained in:
@@ -53,7 +53,7 @@ export function _getTypeAnnotation(): ?Object {
|
||||
}
|
||||
|
||||
inferer = inferers[this.parentPath.type];
|
||||
if (inferer && inferer.validParent) {
|
||||
if (inferer?.validParent) {
|
||||
return this.parentPath.getTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export function VariableDeclarator() {
|
||||
|
||||
let type = init.getTypeAnnotation();
|
||||
|
||||
if (type && type.type === "AnyTypeAnnotation") {
|
||||
if (type?.type === "AnyTypeAnnotation") {
|
||||
// Detect "var foo = Array()" calls so we can optimize for arrays vs iterables.
|
||||
if (
|
||||
init.isCallExpression() &&
|
||||
|
||||
Reference in New Issue
Block a user