Skip to content

Commit

Permalink
various docs improvements
Browse files Browse the repository at this point in the history
- improve description for parser param
- fix typos
- improveme fileLocation description
  • Loading branch information
chris48s committed Aug 19, 2024
1 parent 4316ded commit 071255b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/docs/plugins/writing-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Plugins are invoked in the following sequence:

Plugins that the user has specified in the config file are run first. These are executed in the order they are specified in the config file.

v8r's core plugins run second. The order of execution or core plugins is non-configurable.
v8r's core plugins run second. The order of execution for core plugins is non-configurable.

## Hook Types

Expand Down
18 changes: 11 additions & 7 deletions src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class BasePlugin {
* `dotRelative` option. This means relative paths in the current directory
* will be prefixed with `./` (or `.\` on Windows) even if this was not
* present in the input filename or pattern.
* @param {string | undefined} parser - If this filename matched a file parser
* the user has specified in a custom schema, this will be passed to
* `parseFile` in the `parser` param.
* @param {string | undefined} parser - If the user has specified a parser to
* use for this file in a custom schema, this will be passed to `parseFile`
* in the `parser` param.
* @returns {Document | undefined} Parsed file contents
*/
// eslint-disable-next-line no-unused-vars
Expand Down Expand Up @@ -70,7 +70,7 @@ class BasePlugin {
* `getSingleResultLogMessage` returns undefined, v8r will move on to the next
* plugin in the stack.
*
* Any mesage returned from this function will be written to stdout.
* Any message returned from this function will be written to stdout.
*
* @param {ValidationResult} result - Result of attempting to validate this
* document.
Expand All @@ -97,7 +97,7 @@ class BasePlugin {
* `getAllResultsLogMessage` returns undefined, v8r will move on to the next
* plugin in the stack.
*
* Any mesage returned from this function will be written to stdout.
* Any message returned from this function will be written to stdout.
*
* @param {ValidationResult[]} results - Results of attempting to validate
* these documents.
Expand Down Expand Up @@ -198,8 +198,12 @@ async function loadAllPlugins(userPlugins) {

/**
* @typedef {object} ValidationResult
* @property {string} fileLocation - Filename of the document that was
* validated.
* @property {string} fileLocation - Path of the document that was validated.
* Filenames are resolved and normalised by
* [glob](https://www.npmjs.com/package/glob) using the `dotRelative` option.
* This means relative paths in the current directory will be prefixed with
* `./` (or `.\` on Windows) even if this was not present in the input
* filename or pattern.
* @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
Expand Down

0 comments on commit 071255b

Please sign in to comment.