diff --git a/src/core/rules/html-lang-require.ts b/src/core/rules/html-lang-require.ts new file mode 100644 index 000000000..9324a270a --- /dev/null +++ b/src/core/rules/html-lang-require.ts @@ -0,0 +1,66 @@ +import { Rule } from '../types' + +const regular = + '(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)' +const irregular = + '(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)' +const grandfathered = `(?${irregular}|${regular})` +const privateUse = '(?x(-[A-Za-z0-9]{1,8})+)' +const privateUse2 = '(?x(-[A-Za-z0-9]{1,8})+)' +const singleton = '[0-9A-WY-Za-wy-z]' +const extension = `(?${singleton}(-[A-Za-z0-9]{2,8})+)` +const variant = '(?[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})' +const region = '(?[A-Za-z]{2}|[0-9]{3})' +const script = '(?