--- /dev/null
+'use strict';
+
+/**
+ * A brief wrapper around html-validate
+ */
+
+const assert = require('node:assert');
+const { HtmlValidate } = require('html-validate'); // eslint-disable-line node/no-unpublished-require
+const stubLogger = require('./stub-logger');
+
+class LintHtml {
+ constructor(logger, ...args) {
+ this.logger = logger;
+ this.htmlValidate = new HtmlValidate(...args);
+ }
+
+ async lint(html) {
+ const ruleViolations = [];
+ const report = await this.htmlValidate.validateString(html);
+ report.results.forEach((m) => {
+ ruleViolations.push(m.ruleId);
+ stubLogger?.debug('LintHtml', 'message', m);
+ })
+ assert(report.valid, '' + ruleViolations.join(', '));
+ }
+}
+
+module.exports = LintHtml;
\ No newline at end of file