Improve type fidelity.

This commit is contained in:
David Anson
2026-03-25 21:34:49 -07:00
parent 08fc3a21b1
commit 63a898cb49
2 changed files with 12 additions and 6 deletions
+6 -3
View File
@@ -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}`)
+6 -3
View File
@@ -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}`)