diff --git a/lib/rules/role-supports-aria-props.js b/lib/rules/role-supports-aria-props.js index 55644c1f..370bb696 100644 --- a/lib/rules/role-supports-aria-props.js +++ b/lib/rules/role-supports-aria-props.js @@ -9,7 +9,10 @@ const elementRolesMap = new ObjectMap() for (const [key, value] of elementRoles.entries()) { // - Remove unused `constraints` key delete key.constraints - key.attributes = key.attributes?.filter(attribute => !('constraints' in attribute)) + // - Remove `constraints` key within `attributes` + for (const attribute of key.attributes || []) { + delete attribute.constraints + } // - Remove empty `attributes` key if (!key.attributes || key.attributes?.length === 0) { delete key.attributes