mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-20 07:50:12 +01:00
wip
This commit is contained in:
parent
284bf0335f
commit
cfe46ea322
2 changed files with 11 additions and 7 deletions
|
|
@ -108,9 +108,15 @@ function validateRuleList(ruleList, synchronous) {
|
|||
* @returns {LintResults} New LintResults instance.
|
||||
*/
|
||||
function newResults(ruleList) {
|
||||
const lintResults = {};
|
||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||
/**
|
||||
* Returns the string representation of a LintResults instance.
|
||||
*
|
||||
* @param {boolean} useAlias True if rule alias should be used instead of name.
|
||||
* @returns {string} String representation of the instance.
|
||||
*/
|
||||
function toString(useAlias) {
|
||||
// eslint-disable-next-line consistent-this, no-invalid-this, unicorn/no-this-assignment
|
||||
const lintResults = this;
|
||||
let ruleNameToRule = null;
|
||||
const results = [];
|
||||
const keys = Object.keys(lintResults);
|
||||
|
|
@ -161,6 +167,7 @@ function newResults(ruleList) {
|
|||
}
|
||||
return results.join("\n");
|
||||
}
|
||||
const lintResults = {};
|
||||
Object.defineProperty(lintResults, "toString", { "value": toString });
|
||||
// @ts-ignore
|
||||
return lintResults;
|
||||
|
|
@ -515,7 +522,7 @@ function lintContent(
|
|||
"config": null
|
||||
});
|
||||
// Function to run for each rule
|
||||
let results = [];
|
||||
const results = [];
|
||||
/**
|
||||
* @param {Rule} rule Rule.
|
||||
* @returns {Promise<void> | null} Promise.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue