0
0
Fork 0
mirror of https://github.com/DavidAnson/markdownlint-cli2-action.git synced 2024-11-21 22:01:30 +01:00

Stub markdownlint-cli2-formatter-default to verify functionality.

This commit is contained in:
David Anson 2021-01-12 22:51:40 -08:00
parent a0ebec2ad9
commit 29c40c5e62

41
dist/index.js vendored
View file

@ -12451,6 +12451,38 @@ Token.prototype.attrJoin = function attrJoin(name, value) {
module.exports = Token; 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: /***/ 3112:
@ -12929,10 +12961,11 @@ const outputSummary =
logMessage, logMessage,
logError logError
}; };
const formattersAndParams = requireIdsAndParams( // const formattersAndParams = requireIdsAndParams(
".", // ".",
outputFormatters || [ [ "markdownlint-cli2-formatter-default" ] ] // outputFormatters || [ [ "markdownlint-cli2-formatter-default" ] ]
); // );
const formattersAndParams = [ [ __nccwpck_require__(8552) ] ];
await Promise.all(formattersAndParams.map((formatterAndParams) => { await Promise.all(formattersAndParams.map((formatterAndParams) => {
const [ formatter, ...formatterParams ] = formatterAndParams; const [ formatter, ...formatterParams ] = formatterAndParams;
return formatter(formatterOptions, ...formatterParams); return formatter(formatterOptions, ...formatterParams);