From 63a898cb49b76a26a0a3f70530e6917c15353072 Mon Sep 17 00:00:00 2001 From: David Anson Date: Wed, 25 Mar 2026 21:34:49 -0700 Subject: [PATCH] Improve type fidelity. --- dist/index.mjs | 9 ++++++--- markdownlint-cli2-action.mjs | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index 29d8426..16d404f 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -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}`) diff --git a/markdownlint-cli2-action.mjs b/markdownlint-cli2-action.mjs index 438b949..c062da5 100644 --- a/markdownlint-cli2-action.mjs +++ b/markdownlint-cli2-action.mjs @@ -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}`)