From 17906c2743b46f4ebd6a35666da73705b3edecf9 Mon Sep 17 00:00:00 2001 From: James Bradbury Date: Thu, 30 Dec 2021 12:31:57 +0000 Subject: [PATCH] use else if where possible --- src/compiler/compile/nodes/Element.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index f9e6f7d8bb..69ce5ac9a6 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -373,23 +373,19 @@ export default class Element extends Node { if (this.name === value) { component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); } - if (this.name === 'nav' && value === 'navigation') { + else if (this.name === 'nav' && value === 'navigation') { component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); } - if (this.name === 'a' && value === 'link') { + else if (this.name === 'a' && value === 'link') { component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); } - if (this.name === 'fieldset' && value === 'group') { + else if (this.name === 'fieldset' && value === 'group') { component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); } - if (this.name === 'ul' && value === 'list') { - component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); - } - - if (this.name === 'main' && value === 'main') { + else if (this.name === 'ul' && value === 'list') { component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); }