Skip to content

Commit 38b96ca

Browse files
committed
fix(lint): Resolve lint issues
1 parent 1dfa911 commit 38b96ca

File tree

8 files changed

+17
-12
lines changed

8 files changed

+17
-12
lines changed

core/lib/decompose.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const logger = require('./log');
44
const lh = require('./lineage_hunter');
55
const lih = require('./list_item_hunter');
6-
const pa = require('./pattern_assembler');
76
const ph = require('./parameter_hunter');
87
const smh = require('./style_modifier_hunter');
98
const addPattern = require('./addPattern');
@@ -13,7 +12,6 @@ const processRecursive = require('./processRecursive');
1312

1413
const lineage_hunter = new lh();
1514
const list_item_hunter = new lih();
16-
const pattern_assembler = new pa();
1715
const parameter_hunter = new ph();
1816
const style_modifier_hunter = new smh();
1917

@@ -96,7 +94,9 @@ module.exports = function (pattern, patternlab, ignoreLineage) {
9694

9795
//find pattern lineage
9896
if (!ignoreLineage) {
99-
lineagePromise.resolve(() => {lineage_hunter.find_lineage(pattern, patternlab);})
97+
lineagePromise.resolve(() => {
98+
lineage_hunter.find_lineage(pattern, patternlab);
99+
});
100100
} else {
101101
lineagePromise = Promise.resolve();
102102
}

core/lib/list_item_hunter.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const list_item_hunter = function () {
3030

3131
//build arrays that repeat the block, however large we need to
3232
const repeatedBlockTemplate = [];
33-
let repeatedBlockHtml = '';
33+
34+
//let repeatedBlockHtml = ''; //todo
3435
for (let i = 0; i < items.indexOf(loopNumberString); i++) {
3536

3637
logger.debug(`list item(s) in pattern ${pattern.patternPartial}, adding ${patternBlock} to repeatedBlockTemplate`);
@@ -53,7 +54,8 @@ const list_item_hunter = function () {
5354
for (let i = 0; i < repeatedBlockTemplate.length; i++) {
5455

5556
let thisBlockTemplate = repeatedBlockTemplate[i];
56-
let thisBlockHTML = "";
57+
58+
//let thisBlockHTML = ""; //todo
5759

5860
//combine listItem data with pattern data with global data
5961
const itemData = listData['' + items.indexOf(loopNumberString)]; //this is a property like "2"
@@ -109,18 +111,20 @@ const list_item_hunter = function () {
109111
//thisBlockHTML = pattern_assembler.renderPattern(thisBlockTemplate, allData, patternlab.partials);
110112

111113
} else {
114+
112115
//just render with mergedData
113116
//TODO
114117
//thisBlockHTML = pattern_assembler.renderPattern(thisBlockTemplate, allData, patternlab.partials);
115118
}
116119

117120
//add the rendered HTML to our string
118-
repeatedBlockHtml = repeatedBlockHtml + thisBlockHTML;
121+
//repeatedBlockHtml = repeatedBlockHtml + thisBlockHTML; //todo
119122
}
120123

121124
//replace the block with our generated HTML
122125
const repeatingBlock = pattern.extendedTemplate.substring(pattern.extendedTemplate.indexOf(liMatch), pattern.extendedTemplate.indexOf(end) + end.length);
123-
pattern.extendedTemplate = pattern.extendedTemplate.replace(repeatingBlock, repeatedBlockHtml);
126+
127+
//pattern.extendedTemplate = pattern.extendedTemplate.replace(repeatingBlock, repeatedBlockHtml); //todo
124128

125129
//update the extendedTemplate in the partials object in case this pattern is consumed later
126130
patternlab.partials[pattern.patternPartial] = pattern.extendedTemplate;

core/lib/object_factory.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ Pattern.prototype = {
121121
return promise.then(results => {
122122
return results;
123123
}).catch((reason) => {
124-
console.log(reason)
125124
return Promise.reject(reason);
126125
});
127126
}

core/lib/parameter_hunter.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ const logger = require('./log');
99
const parseLink = require('./parseLink');
1010
const render = require('./render');
1111
const jsonCopy = require('./json_copy');
12-
const pa = require('./pattern_assembler');
1312
const smh = require('./style_modifier_hunter');
1413

1514
const style_modifier_hunter = new smh();
16-
const pattern_assembler = new pa();
1715

1816
const parameter_hunter = function () {
1917

core/lib/parseLink.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ module.exports = function (patternlab, obj, key) {
5555
}
5656

5757
return dataObj;
58-
}
58+
};

core/lib/pattern_assembler.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,22 @@ const pattern_assembler = function () {
276276
mark_modified_patterns: function (lastModified, patternlab) {
277277
return markModifiedPatterns(lastModified, patternlab);
278278
},
279+
279280
//todo review for deletion
280281
find_pattern_partials: function (pattern) {
281282
return pattern.findPartials();
282283
},
284+
283285
//todo review for deletion
284286
find_pattern_partials_with_style_modifiers: function (pattern) {
285287
return pattern.findPartialsWithStyleModifiers();
286288
},
289+
287290
//todo review for deletion
288291
find_pattern_partials_with_parameters: function (pattern) {
289292
return pattern.findPartialsWithPatternParameters();
290293
},
294+
291295
//todo review for deletion
292296
find_list_items: function (pattern) {
293297
return pattern.findListItems();

core/lib/patternlab.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ module.exports = class PatternLab {
364364

365365
//re-rendering the headHTML each time allows pattern-specific data to influence the head of the pattern
366366
pattern.header = head;
367+
367368
// const headHTML
368369
const headPromise = Promise.resolve(render(Pattern.createEmpty({extendedTemplate: pattern.header}), allData));
369370

core/lib/ui_builder.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const renderSync = require('./lib/renderSync');
1313

1414
//these are mocked in unit tests, so let them be overridden
1515
let fs = require('fs-extra'); //eslint-disable-line prefer-const
16-
let pattern_assembler = require('./pattern_assembler')(); //eslint-disable-line prefer-const
1716

1817
const ui_builder = function () {
1918

0 commit comments

Comments
 (0)