2018-07-20 22:31:41 -07:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
2024-11-28 20:36:44 -08:00
|
|
|
/** @type {import("../../../lib/markdownlint.mjs").Rule} */
|
2018-07-20 22:31:41 -07:00
|
|
|
module.exports = {
|
|
|
|
|
"names": [ "sample-rule" ],
|
|
|
|
|
"description": "Sample rule",
|
|
|
|
|
"tags": [ "sample" ],
|
2024-03-09 16:17:50 -08:00
|
|
|
"parser": "markdownit",
|
2018-07-20 22:31:41 -07:00
|
|
|
"function": function rule(params, onError) {
|
2023-02-18 21:41:07 -08:00
|
|
|
for (const token of params.parsers.markdownit.tokens) {
|
2018-07-20 22:31:41 -07:00
|
|
|
if (token.type === "hr") {
|
|
|
|
|
onError({
|
|
|
|
|
"lineNumber": token.lineNumber,
|
|
|
|
|
"detail": "Sample error for hr"
|
|
|
|
|
});
|
|
|
|
|
}
|
2022-06-08 22:10:27 -07:00
|
|
|
}
|
2018-07-20 22:31:41 -07:00
|
|
|
}
|
|
|
|
|
};
|