Skip to content

Commit fc503dc

Browse files
author
Jonathan Stewmon
committed
take a stance on semicolons
1 parent 912536a commit fc503dc

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ rules:
179179
quotes: 0
180180
require-jsdoc: 0
181181
semi-spacing: 0
182-
semi: 0
182+
semi: [error, always]
183183
sort-vars: 0
184184
space-after-keywords: 0
185185
space-before-blocks: 0

example/html-to-text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var path = require('path');
22

33
var htmlToText = require('../lib/html-to-text');
44

5-
console.log('fromString:')
5+
console.log('fromString:');
66
var text = htmlToText.fromString('<h1>Hello World</h1>', {
77
wordwrap: 130
88
});

lib/formatter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ function formatLineBreak(elem, fn, options) {
3838
}
3939

4040
function formatParagraph(elem, fn, options) {
41-
var paragraph = fn(elem.children, options)
41+
var paragraph = fn(elem.children, options);
4242
if (options.singleNewLineParagraphs) {
43-
return paragraph + '\n'
43+
return paragraph + '\n';
4444
} else {
45-
return paragraph + '\n\n'
45+
return paragraph + '\n\n';
4646
}
4747
}
4848

@@ -139,12 +139,12 @@ function formatOrderedList(elem, fn, options) {
139139
// TODO Imeplement the other valid types
140140
// Fallback to type '1' function for other valid types
141141
switch(olType) {
142-
case 'a': return function(start, i) { return String.fromCharCode(i + start + 97)};
143-
case 'A': return function(start, i) { return String.fromCharCode(i + start + 65)};
142+
case 'a': return function(start, i) { return String.fromCharCode(i + start + 97);};
143+
case 'A': return function(start, i) { return String.fromCharCode(i + start + 65);};
144144
case '1':
145-
default: return function(start, i) { return i + 1 + start};
145+
default: return function(start, i) { return i + 1 + start;};
146146
}
147-
}())
147+
}());
148148
// Make sure there are list items present
149149
if (nonWhiteSpaceChildren.length) {
150150
// Calculate initial start from ol attribute

lib/html-to-text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ function filterBody(dom, options, baseElement) {
6969
var documentClasses = elem.attribs && elem.attribs.class ? elem.attribs.class.split(" ") : [];
7070
var documentIds = elem.attribs && elem.attribs.id ? elem.attribs.id.split(" ") : [];
7171

72-
if ((splitTag.classes.every(function (val) { return documentClasses.indexOf(val) >= 0 })) &&
73-
(splitTag.ids.every(function (val) { return documentIds.indexOf(val) >= 0 }))) {
72+
if ((splitTag.classes.every(function (val) { return documentClasses.indexOf(val) >= 0; })) &&
73+
(splitTag.ids.every(function (val) { return documentIds.indexOf(val) >= 0; }))) {
7474
result = [elem];
7575
return;
7676
}

test/html-to-text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ describe('html-to-text', function() {
370370
}
371371
});
372372
expect(result).to.equal('====\ntest\n====');
373-
})
373+
});
374374
});
375375

376376
describe('Base element', function () {
@@ -605,5 +605,5 @@ describe('html-to-text', function() {
605605
testString += "</body></html>";
606606
expect(htmlToText.fromString(testString)).to.equal(expectedResult);
607607
});
608-
})
608+
});
609609
});

0 commit comments

Comments
 (0)