Registry / testing / markdownlint-cli2-formatter-template

markdownlint-cli2-formatter-template

JSON →
library0.0.4jsnpmunverified

An output formatter for markdownlint-cli2 that allows custom formatting of linting results using a template string with tokens. This package is at version 0.0.4 and has no release cadence specified. It is one of several formatters available for markdownlint-cli2, and provides flexibility to generate custom output formats like GitHub Actions workflow commands or Azure Pipelines LogIssue format. It requires markdownlint-cli2 >=0.0.4 as a peer dependency.

npm install markdownlint-cli2-formatter-template
INSTALL
IMPORT
SIG · MARKDOWNLINT-CLI2-
M
markdownlint-cli2-formatter-template
testingjavascriptv0.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
module.exports = {} // not directly imported, used via markdownlint-cli2 config
import formatter from 'markdownlint-cli2-formatter-template'
This package is a plugin for markdownlint-cli2 and is not directly imported in code. It is specified in the configuration file under outputFormatters.

Configures markdownlint-cli2 to use this formatter with a GitHub Actions workflow command template.

{ "outputFormatters": [ [ "markdownlint-cli2-formatter-template", { "template": "::${errorSeverity:${errorSeverity}}${errorSeverity!error} file=${fileName},line=${lineNumber},${columnNumber:col=${columnNumber},}title=${ruleName}::${ruleDescription}" } ] ] }
Debug
Known issues
gotchaToken syntax uses `${token:text if present}` and `${token!text if not present}` but only one level of nesting is supported.
fix
Avoid nested templates; use flat token references.
affects: *
gotchaIf a token is not defined and not guarded with `!` syntax, it outputs an empty string. This may lead to unexpected output formatting.
fix
Use `${token!fallback}` to provide a default value.
affects: *
gotchaThe package requires markdownlint-cli2 >=0.0.4 as a peer dependency. Missing it will cause runtime errors.
fix
Ensure markdownlint-cli2 is installed: npm install markdownlint-cli2 --save-dev
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'markdownlint-cli2-formatter-template'
Package not installed or missing from node_modules.
fix
Run npm install markdownlint-cli2-formatter-template --save-dev
Invalid template: unexpected token
Malformed template string with incorrect syntax.
fix
Ensure tokens use `${token}` or `${token:text if present}`/`${token!text if not present}` without nesting.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
markdownlint-cli2requiredpeer dependency required for runtime
Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
markdownlint-cli2-formatter-template — npm install markdownlint-cli2-formatter-template · libregistry