Skip to content

Commit

Permalink
Update html-validate rules
Browse files Browse the repository at this point in the history
Removes the `no-redundant-role` override. This now defaults to not allowing redundant `role` attributes.

Adds an exception for `fieldset`s with a `role` of `group`, which we're choosing to maintain for assistive technology support.
  • Loading branch information
querkmachine committed Mar 12, 2024
1 parent 1450c42 commit 6d0cdb8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/govuk-frontend/.htmlvalidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ module.exports = defineConfig({
// Require all form field and ARIA references to exist
'no-missing-references': 'error',

// Allow for explicit roles on regions that have implict roles
// We do this to better support AT with older versions of IE that
// have partial support for HTML5 semantic elements
'no-redundant-role': 'off',

// More hassle than it's worth 👾
'no-trailing-whitespace': 'off',

Expand Down Expand Up @@ -68,6 +63,13 @@ module.exports = defineConfig({
attributes: {
type: { required: false }
}
},
fieldset: {
attributes: {
role: {
enum: ['group']
}
}
}
}
]
Expand Down

0 comments on commit 6d0cdb8

Please sign in to comment.