mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Add validation of onError callback object for rules.
This commit is contained in:
parent
802c81f929
commit
7a752784f1
7 changed files with 107 additions and 12 deletions
|
|
@ -14,8 +14,7 @@ module.exports = {
|
|||
onError({
|
||||
"lineNumber": blockquote.lineNumber,
|
||||
"detail": "Blockquote spans " + lines + " line(s).",
|
||||
"context": blockquote.line.substr(0, 7),
|
||||
"range": null
|
||||
"context": blockquote.line.substr(0, 7)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ module.exports = {
|
|||
if ((lineNumber % n) === 0) {
|
||||
onError({
|
||||
"lineNumber": lineNumber,
|
||||
"detail": "Line number " + lineNumber,
|
||||
"context": null,
|
||||
"range": null
|
||||
"detail": "Line number " + lineNumber
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ module.exports = {
|
|||
"function": function rule(params, onError) {
|
||||
// Unconditionally report an error for line 1
|
||||
onError({
|
||||
"lineNumber": 1,
|
||||
"detail": null,
|
||||
"context": null,
|
||||
"range": null
|
||||
"lineNumber": 1
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@ module.exports = {
|
|||
if (index !== -1) {
|
||||
onError({
|
||||
"lineNumber": text.lineNumber,
|
||||
"detail": null,
|
||||
"context": text.content.substr(index - 1, 4),
|
||||
"range": null
|
||||
"context": text.content.substr(index - 1, 4)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue