Skip to content

Commit

Permalink
Add @ts-expect-error to incorrect NodeList types
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Jan 19, 2023
1 parent f02b782 commit c233445
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/govuk/components/checkboxes/checkboxes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Checkboxes.prototype.unCheckAllInputsExcept = function ($input) {
var $component = this

/** @type {NodeListOf<HTMLInputElement>} */
// @ts-expect-error `NodeListOf<HTMLInputElement>` type expected
var allInputsWithSameName = document.querySelectorAll(
'input[type="checkbox"][name="' + $input.name + '"]'
)
Expand All @@ -149,6 +150,7 @@ Checkboxes.prototype.unCheckExclusiveInputs = function ($input) {
var $component = this

/** @type {NodeListOf<HTMLInputElement>} */
// @ts-expect-error `NodeListOf<HTMLInputElement>` type expected
var allInputsWithSameNameAndExclusiveBehaviour = document.querySelectorAll(
'input[data-behaviour="exclusive"][type="checkbox"][name="' + $input.name + '"]'
)
Expand Down
1 change: 1 addition & 0 deletions src/govuk/components/tabs/tabs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ Tabs.prototype.showTab = function ($tab) {
* @returns {HTMLAnchorElement | null} Tab link
*/
Tabs.prototype.getTab = function (hash) {
// @ts-expect-error `HTMLAnchorElement` type expected
return this.$module.querySelector('a.govuk-tabs__tab[href="' + hash + '"]')
}

Expand Down

0 comments on commit c233445

Please sign in to comment.