mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +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
|
|
@ -5,7 +5,7 @@
|
|||
const path = require("node:path");
|
||||
const { promisify } = require("node:util");
|
||||
const micromark = require("../helpers/micromark-parse.cjs");
|
||||
// const { deprecatedRuleNames } = require("./constants");
|
||||
const { version } = require("./constants");
|
||||
const rules = require("./rules");
|
||||
const helpers = require("../helpers");
|
||||
const cache = require("./cache");
|
||||
|
|
@ -525,6 +525,7 @@ function lintContent(
|
|||
const parsersNone = Object.freeze({});
|
||||
const paramsBase = {
|
||||
name,
|
||||
version,
|
||||
"lines": Object.freeze(lines),
|
||||
"frontMatterLines": Object.freeze(frontMatterLines)
|
||||
};
|
||||
|
|
@ -1209,7 +1210,7 @@ function readConfigSync(file, parsers, fs) {
|
|||
* @returns {string} SemVer string.
|
||||
*/
|
||||
function getVersion() {
|
||||
return require("./constants").version;
|
||||
return version;
|
||||
}
|
||||
|
||||
// Export a/synchronous/Promise APIs
|
||||
|
|
@ -1246,6 +1247,7 @@ module.exports = markdownlint;
|
|||
* @property {readonly string[]} lines File/string lines.
|
||||
* @property {readonly string[]} frontMatterLines Front matter lines.
|
||||
* @property {RuleConfiguration} config Rule configuration.
|
||||
* @property {string} version Version of the markdownlint library.
|
||||
*/
|
||||
|
||||
/* eslint-enable jsdoc/valid-types */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue