Fixed automatically converted optional chain

This commit is contained in:
Adam Gastineau 2024-12-17 10:21:03 -08:00
parent 932785b132
commit 8969b2451d

View file

@ -201,7 +201,8 @@ const kPresentationInheritanceParents: { [tagName: string]: string[] } = {
};
function getImplicitAriaRole(element: Element): AriaRole | null {
const implicitRole = kImplicitRoleByTagName[elementSafeTagName(element)](element) || '';
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const implicitRole = kImplicitRoleByTagName[elementSafeTagName(element)]?.(element) || '';
if (!implicitRole) {
return null;
}