mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2026-07-02 16:00:50 +02:00
Improve type fidelity.
This commit is contained in:
Vendored
+6
-3
@@ -80315,7 +80315,7 @@ const markdownlint_cli2_main = async (/** @type {Parameters} */ params) => {
|
||||
|
||||
|
||||
const logMessage = info;
|
||||
const outputFormatter = (/** @type {any} */ options) => {
|
||||
const outputFormatter = (/** @type {import("markdownlint-cli2").OutputFormatterOptions} */ options) => {
|
||||
const { results } = options;
|
||||
for (const lintError of results) {
|
||||
const {
|
||||
@@ -80374,14 +80374,17 @@ if (fix) {
|
||||
argv.push("--fix");
|
||||
}
|
||||
|
||||
/** @type {import("markdownlint-cli2").Parameters} */
|
||||
const parameters = {
|
||||
argv,
|
||||
logMessage,
|
||||
"optionsOverride": {
|
||||
"outputFormatters": [ [ outputFormatter ] ]
|
||||
"outputFormatters": [
|
||||
// @ts-ignore
|
||||
[ outputFormatter ]
|
||||
]
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
markdownlint_cli2_main(parameters).then(
|
||||
(code) => code && setFailed(`Failed with exit code: ${code}`),
|
||||
(error) => setFailed(`Failed due to error: ${error}`)
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as core from "@actions/core";
|
||||
import { main as markdownlintCli2 } from "markdownlint-cli2";
|
||||
|
||||
const logMessage = core.info;
|
||||
const outputFormatter = (/** @type {any} */ options) => {
|
||||
const outputFormatter = (/** @type {import("markdownlint-cli2").OutputFormatterOptions} */ options) => {
|
||||
const { results } = options;
|
||||
for (const lintError of results) {
|
||||
const {
|
||||
@@ -63,14 +63,17 @@ if (fix) {
|
||||
argv.push("--fix");
|
||||
}
|
||||
|
||||
/** @type {import("markdownlint-cli2").Parameters} */
|
||||
const parameters = {
|
||||
argv,
|
||||
logMessage,
|
||||
"optionsOverride": {
|
||||
"outputFormatters": [ [ outputFormatter ] ]
|
||||
"outputFormatters": [
|
||||
// @ts-ignore
|
||||
[ outputFormatter ]
|
||||
]
|
||||
}
|
||||
};
|
||||
// @ts-ignore
|
||||
markdownlintCli2(parameters).then(
|
||||
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
||||
(error) => core.setFailed(`Failed due to error: ${error}`)
|
||||
|
||||
Reference in New Issue
Block a user