no-missing-lang
Require a lang attribute on the <html> element.
astro-doctor/no-missing-lang
Why it matters
Screen readers and search engines use the lang attribute to determine page language and apply the correct pronunciation rules or translation hints. A missing lang attribute is a WCAG 2.1 Level A failure (Success Criterion 3.1.1).
See the difference
Incorrect
Missing lang attribute
---
---
<html>
<head><title>My Astro Site</title></head>
<body>...</body>
</html>Correct
lang attribute set
---
---
<html lang="en">
<head><title>My Astro Site</title></head>
<body>...</body>
</html>Configure this check
Override the default severity in your ESLint config:
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'
export default [
astroDoctorPlugin.configs.recommended,
{
rules: {
'astro-doctor/no-missing-lang': 'error',
},
},
]Or set the severity for CLI scans in doctor.config.ts:
export default {
rules: {
'astro-doctor/no-missing-lang': 'error',
},
}Use 'error', 'warn', or 'off'. The configuration guide covers presets and per-file overrides.