Accessibility error by default astro-doctor/no-missing-lang

no-missing-lang

Require a lang attribute on the <html> element.

Why

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).

Examples

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>

Configuration

Override the default severity in your ESLint config:

// eslint.config.js
import astroDoctorPlugin from '@santi020k/eslint-plugin-astro-doctor'

export default [
  astroDoctorPlugin.configs.recommended,
  {
    rules: {
      'astro-doctor/no-missing-lang': 'error',   // or 'warn' or 'off'
    },
  },
]
       
  

Or in your doctor.config.ts:

export default {
  rules: {
    'astro-doctor/no-missing-lang': 'error',
  },
}
       
  

All rules