Skip to content

Commit

Permalink
move typedef
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Aug 8, 2024
1 parent 5d78af6 commit 159a3c8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ class BasePlugin {
}
}

/**
* @typedef {object} ValidationResult
* @property {string} fileLocation - Filename of the document that was validated.
* @property {string|null} schemaLocation - Location of the schema used to
* validate this file if one could be found. `null` if no schema was found.
* @property {boolean|null} valid - Result of the validation (true/false)
* if a schema was found. `null` if no schema was found and no validation
* could be performed.
* @property {ErrorObject[]} errors - An array of
* [AJV Error Objects](https://ajv.js.org/api.html#error-objects)
* describing any errors encountered when validating this document.
*/

function validatePlugin(plugin) {
if (
typeof plugin.name !== "string" ||
Expand Down Expand Up @@ -188,4 +175,17 @@ async function loadAllPlugins(userPlugins) {
};
}

/**
* @typedef {object} ValidationResult
* @property {string} fileLocation - Filename of the document that was validated.
* @property {string|null} schemaLocation - Location of the schema used to
* validate this file if one could be found. `null` if no schema was found.
* @property {boolean|null} valid - Result of the validation (true/false)
* if a schema was found. `null` if no schema was found and no validation
* could be performed.
* @property {ErrorObject[]} errors - An array of
* [AJV Error Objects](https://ajv.js.org/api.html#error-objects)
* describing any errors encountered when validating this document.
*/

export { BasePlugin, loadAllPlugins, resolveUserPlugins };

0 comments on commit 159a3c8

Please sign in to comment.