···7272// the correct markup.
7373async function checkA11y(html: string): Promise<void> {
7474 document.open();
7575+ // document.write is deprecated in browsers but is the only reliable way to
7676+ // fully replace jsdom's global document (including <html lang="en">) for
7777+ // axe-core. Alternatives like innerHTML assignment silently drop <html lang>,
7878+ // which causes axe to report a spurious html-has-lang violation.
7979+ // eslint-disable-next-line @typescript-eslint/no-deprecated
7580 document.write(html);
7681 document.close();
7782 const results = await axe.run({