mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Add MD004 with tests, support disabling rules.
This commit is contained in:
parent
d2e38c1646
commit
2da9462e45
13 changed files with 201 additions and 7 deletions
|
|
@ -24,12 +24,14 @@ function lintFile(file, config, callback) {
|
|||
var result = {};
|
||||
rules.forEach(function forRule(rule) {
|
||||
var ruleConfig = config[rule.name];
|
||||
params.options = (ruleConfig instanceof Object) ? ruleConfig : {};
|
||||
var errors = [];
|
||||
rule.func(params, errors);
|
||||
if (errors.length) {
|
||||
errors.sort(numberComparison);
|
||||
result[rule.name] = errors.filter(uniqueFilterForSorted);
|
||||
if ((ruleConfig === undefined) || ruleConfig) {
|
||||
params.options = (ruleConfig instanceof Object) ? ruleConfig : {};
|
||||
var errors = [];
|
||||
rule.func(params, errors);
|
||||
if (errors.length) {
|
||||
errors.sort(numberComparison);
|
||||
result[rule.name] = errors.filter(uniqueFilterForSorted);
|
||||
}
|
||||
}
|
||||
});
|
||||
callback(null, result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue