mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2024-11-21 13:51:28 +01:00
Stub markdownlint-cli2-formatter-default to verify functionality.
This commit is contained in:
parent
a0ebec2ad9
commit
29c40c5e62
1 changed files with 37 additions and 4 deletions
41
dist/index.js
vendored
41
dist/index.js
vendored
|
@ -12451,6 +12451,38 @@ Token.prototype.attrJoin = function attrJoin(name, value) {
|
|||
module.exports = Token;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8552:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
// @ts-check
|
||||
|
||||
|
||||
|
||||
// Formats markdownlint-cli2 results in the style of `markdownlint-cli`
|
||||
const outputFormatter = (options) => {
|
||||
const { results, logError } = options;
|
||||
for (const errorInfo of results) {
|
||||
const { fileName, lineNumber, ruleNames, ruleDescription, errorDetail,
|
||||
errorContext, errorRange } = errorInfo;
|
||||
const ruleName = ruleNames.join("/");
|
||||
const description = ruleDescription +
|
||||
(errorDetail ? ` [${errorDetail}]` : "") +
|
||||
(errorContext ? ` [Context: "${errorContext}"]` : "");
|
||||
const column = (errorRange && errorRange[0]) || 0;
|
||||
const columnText = column ? `:${column}` : "";
|
||||
logError(
|
||||
`${fileName}:${lineNumber}${columnText} ${ruleName} ${description}`
|
||||
);
|
||||
}
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
module.exports = outputFormatter;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3112:
|
||||
|
@ -12929,10 +12961,11 @@ const outputSummary =
|
|||
logMessage,
|
||||
logError
|
||||
};
|
||||
const formattersAndParams = requireIdsAndParams(
|
||||
".",
|
||||
outputFormatters || [ [ "markdownlint-cli2-formatter-default" ] ]
|
||||
);
|
||||
// const formattersAndParams = requireIdsAndParams(
|
||||
// ".",
|
||||
// outputFormatters || [ [ "markdownlint-cli2-formatter-default" ] ]
|
||||
// );
|
||||
const formattersAndParams = [ [ __nccwpck_require__(8552) ] ];
|
||||
await Promise.all(formattersAndParams.map((formatterAndParams) => {
|
||||
const [ formatter, ...formatterParams ] = formatterAndParams;
|
||||
return formatter(formatterOptions, ...formatterParams);
|
||||
|
|
Loading…
Reference in a new issue