create(context) {
    return {
      TaggedTemplateExpression(node) {
        if (isHtmlTaggedTemplate(node, context)) {
          const analyzer = TemplateAnalyzer.create(node);

          analyzer.traverse({
            enterElement(element) {
              if (element.name === 'html') {
                const lang = getLiteralAttributeValue(
                  analyzer,
                  element,
                  'lang',
                  getContextSourceCode(context),
                );

                if (!lang) {
                  const loc = analyzer.resolveLocation(
                    element.sourceCodeLocation.startTag,
                    getContextSourceCode(context),
                  );

                  return context.report({
                    loc,
                    messageId: 'noLangPresent',
                  });
                }

                // We cast this as string, as lang could be a number, since getLiteralAttributeValue returns a primitive, this would throw an error as `language-tags` performs string methods on the argument
                if (!tags.check(`${lang}`)) {
                  const loc =
                    analyzer.getLocationForAttribute(
                      element,
                      'lang',
                      getContextSourceCode(context),
                    ) ?? node.loc;

                  return context.report({
                    loc,
                    messageId: 'invalidLang',
                  });
                }
              }
            },
          });
        }
      },
    };
  }
@fileoverview Ensures the document has a valid `lang` attribute.
@author open-wc