Skip to content

Commit d562d6e

Browse files
despairbluewooorm
authored andcommittedJun 6, 2016
Update list-item-spacing message
Closes GH-60. Closes GH-62.
1 parent 019ff36 commit d562d6e

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed
 

‎lib/rules/list-item-spacing.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,17 @@ function listItemSpacing(ast, file, preferred, done) {
103103
*/
104104

105105
if (isTight !== isTightList) {
106-
file.warn('List item should be ' + type + ', isn’t', {
107-
'start': end(item),
108-
'end': start(next)
109-
});
106+
if (type === 'loose') {
107+
file.warn('Missing new line after list item', {
108+
'start': end(item),
109+
'end': start(next)
110+
});
111+
} else {
112+
file.warn('Extraneous new line after list item', {
113+
'start': end(item),
114+
'end': start(next)
115+
});
116+
}
110117
}
111118
});
112119
});

‎test/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1416,13 +1416,13 @@ describe('Rules', function () {
14161416
describeRule('list-item-spacing', function () {
14171417
describeSetting(true, function () {
14181418
assertFile('list-item-spacing-tight-invalid.md', [
1419-
'list-item-spacing-tight-invalid.md:2:1-3:1: List item should be tight, isn’t',
1420-
'list-item-spacing-tight-invalid.md:4:1-5:1: List item should be tight, isn’t'
1419+
'list-item-spacing-tight-invalid.md:2:1-3:1: Extraneous new line after list item',
1420+
'list-item-spacing-tight-invalid.md:4:1-5:1: Extraneous new line after list item'
14211421
]);
14221422

14231423
assertFile('list-item-spacing-loose-invalid.md', [
1424-
'list-item-spacing-loose-invalid.md:2:9-3:1: List item should be loose, isn’t',
1425-
'list-item-spacing-loose-invalid.md:3:11-4:1: List item should be loose, isn’t'
1424+
'list-item-spacing-loose-invalid.md:2:9-3:1: Missing new line after list item',
1425+
'list-item-spacing-loose-invalid.md:3:11-4:1: Missing new line after list item'
14261426
]);
14271427

14281428
assertFile('list-item-spacing-tight-valid.md', []);

0 commit comments

Comments
 (0)
Please sign in to comment.