Skip to content

Commit 95c60cf

Browse files
committed
Don't delete all of attributes
1 parent 951feea commit 95c60cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/rules/role-supports-aria-props.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const elementRolesMap = new ObjectMap()
99
for (const [key, value] of elementRoles.entries()) {
1010
// - Remove unused `constraints` key
1111
delete key.constraints
12-
key.attributes = key.attributes?.filter(attribute => !('constraints' in attribute))
12+
// - Remove `constraints` key within `attributes`
13+
for (const attribute of key.attributes || []) {
14+
delete attribute.constraints
15+
}
1316
// - Remove empty `attributes` key
1417
if (!key.attributes || key.attributes?.length === 0) {
1518
delete key.attributes

0 commit comments

Comments
 (0)