mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Update list-item-spacing
message
Closes GH-60. Closes GH-62.
This commit is contained in:
parent
019ff36470
commit
d562d6eba7
@ -103,10 +103,17 @@ function listItemSpacing(ast, file, preferred, done) {
|
||||
*/
|
||||
|
||||
if (isTight !== isTightList) {
|
||||
file.warn('List item should be ' + type + ', isn’t', {
|
||||
'start': end(item),
|
||||
'end': start(next)
|
||||
});
|
||||
if (type === 'loose') {
|
||||
file.warn('Missing new line after list item', {
|
||||
'start': end(item),
|
||||
'end': start(next)
|
||||
});
|
||||
} else {
|
||||
file.warn('Extraneous new line after list item', {
|
||||
'start': end(item),
|
||||
'end': start(next)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1416,13 +1416,13 @@ describe('Rules', function () {
|
||||
describeRule('list-item-spacing', function () {
|
||||
describeSetting(true, function () {
|
||||
assertFile('list-item-spacing-tight-invalid.md', [
|
||||
'list-item-spacing-tight-invalid.md:2:1-3:1: List item should be tight, isn’t',
|
||||
'list-item-spacing-tight-invalid.md:4:1-5:1: List item should be tight, isn’t'
|
||||
'list-item-spacing-tight-invalid.md:2:1-3:1: Extraneous new line after list item',
|
||||
'list-item-spacing-tight-invalid.md:4:1-5:1: Extraneous new line after list item'
|
||||
]);
|
||||
|
||||
assertFile('list-item-spacing-loose-invalid.md', [
|
||||
'list-item-spacing-loose-invalid.md:2:9-3:1: List item should be loose, isn’t',
|
||||
'list-item-spacing-loose-invalid.md:3:11-4:1: List item should be loose, isn’t'
|
||||
'list-item-spacing-loose-invalid.md:2:9-3:1: Missing new line after list item',
|
||||
'list-item-spacing-loose-invalid.md:3:11-4:1: Missing new line after list item'
|
||||
]);
|
||||
|
||||
assertFile('list-item-spacing-tight-valid.md', []);
|
||||
|
Loading…
Reference in New Issue
Block a user