Skip to content

Commit 5b82b9b

Browse files
committed
fix lint issues
1 parent cdedc86 commit 5b82b9b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

core/lib/data_loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function loadDataFromFolder(dataFilesPath, excludeFileNames, fsDep) {
3939
const dataFilesFullPath = dataFilesPath + '*.{json,yml,yaml}',
4040
excludeFullPath = dataFilesPath + excludeFileNames + '.{json,yml,yaml}';
4141

42-
let globOptions = {};
42+
const globOptions = {};
4343
if (excludeFileNames) {
4444
globOptions.ignore = [excludeFullPath];
4545
}
@@ -48,7 +48,7 @@ function loadDataFromFolder(dataFilesPath, excludeFileNames, fsDep) {
4848
let mergeObject = {};
4949

5050
dataFiles.forEach(function (filePath) {
51-
let jsonData = yaml.safeLoad(fsDep.readFileSync(path.resolve(filePath), 'utf8'));
51+
const jsonData = yaml.safeLoad(fsDep.readFileSync(path.resolve(filePath), 'utf8'));
5252
mergeObject = _.merge(mergeObject, jsonData);
5353
});
5454

core/lib/parameter_hunter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ const parameter_hunter = function () {
280280
}
281281

282282
// resolve any pattern links that might be present
283-
paramData = pattern_assembler.parse_data_links_specific(patternlab, paramData, pattern.patternPartial)
283+
paramData = pattern_assembler.parse_data_links_specific(patternlab, paramData, pattern.patternPartial);
284284

285285
//combine all data: GLOBAL DATA => PATTERN.JSON DATA => PARAMETER DATA
286286
let allData = _.merge(globalData, localData);

core/lib/pattern_assembler.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ const smh = require('./style_modifier_hunter');
1414
const ph = require('./parameter_hunter');
1515
const ch = require('./changes_hunter');
1616
const jsonCopy = require('./json_copy');
17+
const da = require('./data_loader');
1718
const markdown_parser = new mp();
1819
const changes_hunter = new ch();
20+
const dataLoader = new da();
1921

2022
//this is mocked in unit tests
2123
let fs = require('fs-extra'); //eslint-disable-line prefer-const
@@ -310,7 +312,7 @@ const pattern_assembler = function () {
310312
//look for a json file for this template
311313
try {
312314
var jsonFilename = path.resolve(patternsPath, currentPattern.subdir, currentPattern.fileName);
313-
let configData = dataLoader.loadDataFromFile(jsonFilename, fs);
315+
const configData = dataLoader.loadDataFromFile(jsonFilename, fs);
314316

315317
if (configData) {
316318
currentPattern.jsonFileData = configData;
@@ -327,7 +329,7 @@ const pattern_assembler = function () {
327329
//look for a listitems.json file for this template
328330
try {
329331
var listJsonFileName = path.resolve(patternsPath, currentPattern.subdir, currentPattern.fileName + ".listitems");
330-
let listItemsConfig = dataLoader.loadDataFromFile(listJsonFileName, fs);
332+
const listItemsConfig = dataLoader.loadDataFromFile(listJsonFileName, fs);
331333

332334
if (listItemsConfig) {
333335
currentPattern.listitems = listItemsConfig;

core/lib/patternlab.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
const diveSync = require('diveSync');
1414
const dive = require('dive');
15-
const glob = require('glob');
1615
const _ = require('lodash');
1716
const path = require('path');
1817
const chalk = require('chalk');

0 commit comments

Comments
 (0)