mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add error/warning severity property to LintError object.
This commit is contained in:
parent
c07a63117a
commit
895f377860
16 changed files with 4079 additions and 911 deletions
|
|
@ -463,6 +463,10 @@ export type LintError = {
|
|||
* Fix information.
|
||||
*/
|
||||
fixInfo: FixInfo | null;
|
||||
/**
|
||||
* Severity of the error.
|
||||
*/
|
||||
severity: "error" | "warning";
|
||||
};
|
||||
/**
|
||||
* Fix information.
|
||||
|
|
|
|||
|
|
@ -637,7 +637,8 @@ function lintContent(
|
|||
"errorDetail": errorInfo.detail?.replace(helpers.newLineRe, " ") || null,
|
||||
"errorContext": errorInfo.context?.replace(helpers.newLineRe, " ") || null,
|
||||
"errorRange": errorInfo.range ? [ ...errorInfo.range ] : null,
|
||||
"fixInfo": fixInfo ? cleanFixInfo : null
|
||||
"fixInfo": fixInfo ? cleanFixInfo : null,
|
||||
"severity": "error"
|
||||
});
|
||||
}
|
||||
// Call (possibly external) rule function to report errors
|
||||
|
|
@ -1501,6 +1502,7 @@ export function getVersion() {
|
|||
* @property {string} errorContext Context for the error.
|
||||
* @property {number[]|null} errorRange Column number (1-based) and length.
|
||||
* @property {FixInfo|null} fixInfo Fix information.
|
||||
* @property {"error" | "warning"} severity Severity of the error.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue