mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Add markdownlint "version" property to custom rule "params" object in case it is ever necessary for a rule to specialize its behavior.
This commit is contained in:
parent
ee50519e00
commit
d3819c4e75
6 changed files with 39 additions and 5 deletions
|
|
@ -1338,6 +1338,30 @@ test("customRulesOnErrorInvalidHandledSync", (t) => {
|
|||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||
});
|
||||
|
||||
test("customRulesVersion", (t) => new Promise((resolve) => {
|
||||
t.plan(2);
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../lib/markdownlint").Options */
|
||||
const options = {
|
||||
"customRules": [
|
||||
{
|
||||
"names": [ "name" ],
|
||||
"description": "description",
|
||||
"tags": [ "tag" ],
|
||||
"parser": "none",
|
||||
"function": function stringName(params) {
|
||||
t.is(params.version, version, "Incorrect version");
|
||||
}
|
||||
}
|
||||
],
|
||||
"files": "doc/CustomRules.md"
|
||||
};
|
||||
markdownlint(options, function callback(err) {
|
||||
t.falsy(err);
|
||||
resolve();
|
||||
});
|
||||
}));
|
||||
|
||||
test("customRulesFileName", (t) => new Promise((resolve) => {
|
||||
t.plan(2);
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue