Add error/warning severity property to LintError object.

This commit is contained in:
David Anson 2025-09-11 20:34:24 -07:00
parent c07a63117a
commit 895f377860
16 changed files with 4079 additions and 911 deletions

View file

@ -463,6 +463,10 @@ export type LintError = {
* Fix information.
*/
fixInfo: FixInfo | null;
/**
* Severity of the error.
*/
severity: "error" | "warning";
};
/**
* Fix information.

View file

@ -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.
*/
/**