update dependencies and devDependencies, fix lint issues
[squeep-html-template-helper] / test / lint-html.js
index 1f2b437c302effc58cc4de8a80d8254822bbe0d3..57f8241200a8d7beee76e491a3e02cb54129d54d 100644 (file)
@@ -6,13 +6,27 @@
 
 const assert = require('node:assert');
 
+/**
+ * @typedef {object} ConsoleLike
+ * @property {Function} debug debug
+ */
+
+/**
+ * @typedef {import('html-validate')} HtmlValidateModule
+ */
+
 /**
  * Given an instance of html-validate, returns a function which asserts validity of some HTML.
- * @param {ConsoleLike} logger
- * @param {HtmlValidate} htmlValidate
- * @returns {(html: String) => Promise<void>}
+ * @param {ConsoleLike} logger logger
+ * @param {HtmlValidateModule.HtmlValidate} htmlValidate html-validate instance
+ * @returns {(html: string) => Promise<void>} function which lints html
  */
 function makeHtmlLint(logger, htmlValidate) {
+  /**
+   * 
+   * @param {any[]} violations array of violations to add to
+   * @param {any} message violation to add
+   */
   function note(violations, message) {
     violations.push(message.ruleId);
     logger.debug('HtmlLint', message);