mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Add simple/concrete example of custom rule package for publishing (fixes #133).
This commit is contained in:
parent
183d9c5cb1
commit
23d5be6015
4 changed files with 49 additions and 9 deletions
19
test/rules/npm/sample-rule.js
Normal file
19
test/rules/npm/sample-rule.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"names": [ "sample-rule" ],
|
||||
"description": "Sample rule",
|
||||
"tags": [ "sample" ],
|
||||
"function": function rule(params, onError) {
|
||||
params.tokens.forEach((token) => {
|
||||
if (token.type === "hr") {
|
||||
onError({
|
||||
"lineNumber": token.lineNumber,
|
||||
"detail": "Sample error for hr"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue