Skip to content

Commit d087d99

Browse files
committed
tightened up eslint semicolons
eslinting
1 parent 4c3c290 commit d087d99

File tree

6 files changed

+25
-28
lines changed

6 files changed

+25
-28
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"no-with": 2,
6868
"quotes": [0, "single"],
6969
"radix": 2,
70-
"semi": [0, "never"],
70+
"semi": [1, "always"],
7171
"strict": 0,
7272
"space-before-blocks": 1,
7373
"space-before-function-paren": [1, {

core/lib/annotation_exporter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ var annotations_exporter = function (pl) {
5959
//take the annotation snippets and split them on our custom delimiter
6060
var annotationsYAML = annotationsMD.split('~*~');
6161
for (var i = 0; i < annotationsYAML.length; i++) {
62-
var annotation = buildAnnotationMD(annotationsYAML[i], markdown_parser)
62+
var annotation = buildAnnotationMD(annotationsYAML[i], markdown_parser);
6363
annotations.push(annotation);
6464
}
6565
return false;
66-
}
66+
};
6767
}
6868

6969
/*
@@ -72,7 +72,7 @@ var annotations_exporter = function (pl) {
7272
function parseAnnotationsMD() {
7373
var markdown_parser = new mp();
7474
var annotations = [];
75-
var mdFiles = glob.sync(paths.source.annotations + '/*.md')
75+
var mdFiles = glob.sync(paths.source.annotations + '/*.md');
7676

7777
mdFiles.forEach(parseMDFile(annotations, markdown_parser));
7878
return annotations;

core/lib/pattern_assembler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ var pattern_assembler = function () {
520520
parseDataLinks(patternlab);
521521
},
522522
parse_data_links_specific: function (patternlab, data, label) {
523-
return parseDataLinksHelper(patternlab, data, label)
523+
return parseDataLinksHelper(patternlab, data, label);
524524
},
525525
parse_pattern_markdown: function (pattern, patternlab) {
526526
parsePatternMarkdown(pattern, patternlab);

core/lib/patternlab.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var diveSync = require('diveSync'),
1414
glob = require('glob'),
1515
_ = require('lodash'),
1616
path = require('path'),
17+
pm = require('./plugin_manager'),
1718
plutils = require('./utilities');
1819

1920
function buildPatternData(dataFilesPath, fs) {
@@ -74,6 +75,19 @@ function checkConfiguration(patternlab) {
7475
patternlab.config.outputFileSuffixes = _.extend(outputFileSuffixes, patternlab.config.outputFileSuffixes);
7576
}
7677

78+
function initializePlugins(patternlab) {
79+
var plugin_manager = new pm(patternlab.config, path.resolve(__dirname, '../../patternlab-config.json'));
80+
var foundPlugins = plugin_manager.detect_plugins();
81+
82+
if (foundPlugins && foundPlugins.length > 0) {
83+
84+
for (var i = 0; i < foundPlugins.length; i++) {
85+
var plugin = plugin_manager.load_plugin(foundPlugins[i]);
86+
plugin(patternlab);
87+
}
88+
}
89+
}
90+
7791
var patternlab_engine = function (config) {
7892
'use strict';
7993

@@ -84,7 +98,6 @@ var patternlab_engine = function (config) {
8498
lh = require('./lineage_hunter'),
8599
ui = require('./ui_builder'),
86100
sm = require('./starterkit_manager'),
87-
pm = require('./plugin_manager'),
88101
patternlab = {};
89102

90103
patternlab.package = fs.readJSONSync(path.resolve(__dirname, '../../package.json'));
@@ -172,19 +185,6 @@ var patternlab_engine = function (config) {
172185
}
173186
}
174187

175-
function initializePlugins(patternlab) {
176-
var plugin_manager = new pm(patternlab.config, path.resolve(__dirname, '../../patternlab-config.json'));
177-
var foundPlugins = plugin_manager.detect_plugins();
178-
179-
if (foundPlugins && foundPlugins.length > 0) {
180-
181-
for (var i = 0; i < foundPlugins.length; i++) {
182-
var plugin = plugin_manager.load_plugin(foundPlugins[i]);
183-
plugin(patternlab);
184-
}
185-
}
186-
}
187-
188188
function setCacheBust() {
189189
if (patternlab.config.cacheBust) {
190190
if (patternlab.config.debug) {

core/lib/plugin_manager.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
var plugin_manager = function (config, configPath) {
44
var path = require('path'),
55
fs = require('fs-extra'),
6-
util = require('./utilities'),
7-
paths = config.paths;
6+
util = require('./utilities');
87

98
function loadPlugin(pluginName) {
10-
var pluginInstance = require(path.join(process.cwd(), 'node_modules', pluginName));
11-
return pluginInstance;
9+
return require(path.join(process.cwd(), 'node_modules', pluginName));
1210
}
1311

1412
function installPlugin(pluginName) {
@@ -39,11 +37,10 @@ var plugin_manager = function (config, configPath) {
3937

4038
function detectPlugins() {
4139
var node_modules_path = path.join(process.cwd(), 'node_modules');
42-
var npm_modules = fs.readdirSync(node_modules_path).filter(function (dir) {
40+
return fs.readdirSync(node_modules_path).filter(function (dir) {
4341
var module_path = path.join(process.cwd(), 'node_modules', dir);
4442
return fs.statSync(module_path).isDirectory() && dir.indexOf('plugin-node-') === 0;
4543
});
46-
return npm_modules;
4744
}
4845

4946
function disablePlugin(pluginName) {
@@ -55,7 +52,7 @@ var plugin_manager = function (config, configPath) {
5552
}
5653

5754
return {
58-
install_plugin: function(pluginName) {
55+
install_plugin: function (pluginName) {
5956
installPlugin(pluginName);
6057
},
6158
load_plugin: function (pluginName) {

core/lib/ui_builder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ var ui_builder = function () {
235235
patternState: pattern.patternState,
236236
patternSrcPath: encodeURI(pattern.subdir + '/' + pattern.fileName),
237237
patternPath: patternPath
238-
}
238+
};
239239
}
240240

241241
/**
@@ -618,7 +618,7 @@ var ui_builder = function () {
618618

619619
return {
620620
buildFrontend: function (patternlab) {
621-
buildFrontend(patternlab)
621+
buildFrontend(patternlab);
622622
},
623623
isPatternExcluded: function (pattern, patternlab) {
624624
return isPatternExcluded(pattern, patternlab);

0 commit comments

Comments
 (0)