Update MD009/no-trailing-spaces to include strict mode (fixes #216).

This commit is contained in:
David Anson 2019-12-09 22:05:57 -08:00
parent a9251c533f
commit 6f3c67f760
10 changed files with 193 additions and 11 deletions

View file

@ -0,0 +1,6 @@
{
"default": true,
"MD009": {
"strict": true
}
}

64
test/hard-line-breaks.md Normal file
View file

@ -0,0 +1,64 @@
# Hard Line Breaks
hard
break
hard\
break
hard
break
hard
break
hard\
break
*hard
break*
*hard\
break*
`code
span`
`code\
span`
not\
not
## not\
### not
- Item
- Item
- Item
- Item
Text text
text `code
span code
span` text
text
Text text
text text
text
{MD009:9}
{MD009:24}
{MD009:32}
{MD009:36}
{MD009:39}
{MD009:41}
{MD009:43}
{MD009:48}
{MD009:54}

View file

@ -1553,6 +1553,7 @@ module.exports.doc = function doc(test) {
ruleUsesParams = ruleUsesParams.map(function forUse(use) {
return use.split(".").pop();
});
ruleUsesParams.sort();
}
} else if (/^Tags: /.test(token.content) && rule) {
test.deepEqual(token.content.split(tagAliasParameterRe).slice(1),
@ -1571,6 +1572,7 @@ module.exports.doc = function doc(test) {
inDetails = inDetails || (part[0] === "(");
return !inDetails;
});
parameters.sort();
test.deepEqual(parameters, ruleUsesParams,
"Missing parameter for rule " + rule.names);
ruleUsesParams = null;

View file

@ -0,0 +1,7 @@
{
"default": true,
"MD009": {
"list_item_empty_lines": true,
"strict": true
}
}

View file

@ -0,0 +1,52 @@
# Heading
1. text
text
1. text
text
1. text
text
1. text
text
1. text
text
1. text
{MD009:16}
{MD009:18}
1. text
text
1. text
text
1. text
text
1. text
text
1. text
text
1. text
1. text
- text
text
- text
text
- text
text
- text
text
{MD009:37}
{MD009:50}