Skip to content

Commit 0714855

Browse files
committed
shortened the eslint consecutive variable declaration indent- because editorconfig did not seem to support it, so the two tools would create contention.
I can live with "misaligned" variables. ask me about work sometime
1 parent c7609d7 commit 0714855

9 files changed

+97
-97
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"eqeqeq": [2, "allow-null"],
1515
"global-strict": [0, "never"],
1616
"guard-for-in": 2,
17-
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 2}],
17+
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
1818
"lines-around-comment": [2, {
1919
"beforeBlockComment": true,
2020
"beforeLineComment": true,

builder/media_hunter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"use strict";
1212

1313
var diveSync = require('diveSync'),
14-
path = require('path'),
15-
fs = require('fs-extra');
14+
path = require('path'),
15+
fs = require('fs-extra');
1616

1717
var media_hunter = function () {
1818

builder/parameter_hunter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
var parameter_hunter = function () {
1414

1515
var extend = require('util')._extend,
16-
pa = require('./pattern_assembler'),
17-
smh = require('./style_modifier_hunter'),
18-
style_modifier_hunter = new smh(),
19-
pattern_assembler = new pa();
16+
pa = require('./pattern_assembler'),
17+
smh = require('./style_modifier_hunter'),
18+
style_modifier_hunter = new smh(),
19+
pattern_assembler = new pa();
2020

2121
function findparameters(pattern, patternlab) {
2222
if (pattern.parameteredPartials && pattern.parameteredPartials.length > 0) {

builder/pattern_assembler.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ var pattern_assembler = function () {
9292
var tempItems = [];
9393
if (i === 1) {
9494
tempItems.push(container.listItemArray[0]);
95-
container.listitems['' + i ] = tempItems;
95+
container.listitems['' + i] = tempItems;
9696
} else {
9797
for (var c = 1; c <= i; c++) {
9898
tempItems.push(container.listItemArray[c - 1]);
99-
container.listitems['' + i ] = tempItems;
99+
container.listitems['' + i] = tempItems;
100100
}
101101
}
102102
}
@@ -136,8 +136,8 @@ var pattern_assembler = function () {
136136

137137
function processPatternIterative(file, patternlab) {
138138
var fs = require('fs-extra'),
139-
of = require('./object_factory'),
140-
path = require('path');
139+
of = require('./object_factory'),
140+
path = require('path');
141141

142142
//extract some information
143143
var subdir = path.dirname(path.relative(patternlab.config.paths.source.patterns, file)).replace('\\', '/');
@@ -206,20 +206,20 @@ var pattern_assembler = function () {
206206

207207
function processPatternRecursive(file, patternlab) {
208208
var lh = require('./lineage_hunter'),
209-
ph = require('./parameter_hunter'),
210-
pph = require('./pseudopattern_hunter'),
211-
lih = require('./list_item_hunter'),
212-
smh = require('./style_modifier_hunter');
209+
ph = require('./parameter_hunter'),
210+
pph = require('./pseudopattern_hunter'),
211+
lih = require('./list_item_hunter'),
212+
smh = require('./style_modifier_hunter');
213213

214214
var parameter_hunter = new ph(),
215-
lineage_hunter = new lh(),
216-
list_item_hunter = new lih(),
217-
style_modifier_hunter = new smh(),
218-
pseudopattern_hunter = new pph();
215+
lineage_hunter = new lh(),
216+
list_item_hunter = new lih(),
217+
style_modifier_hunter = new smh(),
218+
pseudopattern_hunter = new pph();
219219

220220
//find current pattern in patternlab object using var file as a key
221221
var currentPattern,
222-
i;
222+
i;
223223

224224
for (i = 0; i < patternlab.patterns.length; i++) {
225225
if (patternlab.patterns[i].abspath === file) {
@@ -259,7 +259,7 @@ var pattern_assembler = function () {
259259
//identify which pattern this partial corresponds tou
260260
for (var j = 0; j < patternlab.patterns.length; j++) {
261261
if (patternlab.patterns[j].key === partialKey ||
262-
patternlab.patterns[j].abspath.indexOf(partialKey) > -1) {
262+
patternlab.patterns[j].abspath.indexOf(partialKey) > -1) {
263263
partialPath = patternlab.patterns[j].abspath;
264264
}
265265
}

builder/pattern_exporter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v1.1.3 - 2016
3-
*
1+
/*
2+
* patternlab-node - v1.1.3 - 2016
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

@@ -13,7 +13,7 @@
1313
var fs = require('fs-extra');
1414

1515
var pattern_exporter = function () {
16-
16+
1717
function exportPatterns(patternlab) {
1818
//read the config export options
1919
var exportKeys = patternlab.config.patternExportKeys;

builder/patternlab.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ var patternlab_engine = function (config) {
1212
'use strict';
1313

1414
var path = require('path'),
15-
fs = require('fs-extra'),
16-
diveSync = require('diveSync'),
17-
of = require('./object_factory'),
18-
pa = require('./pattern_assembler'),
19-
mh = require('./media_hunter'),
20-
pe = require('./pattern_exporter'),
21-
he = require('html-entities').AllHtmlEntities,
22-
patternlab = {};
15+
fs = require('fs-extra'),
16+
diveSync = require('diveSync'),
17+
of = require('./object_factory'),
18+
pa = require('./pattern_assembler'),
19+
mh = require('./media_hunter'),
20+
pe = require('./pattern_exporter'),
21+
he = require('html-entities').AllHtmlEntities,
22+
patternlab = {};
2323

2424
patternlab.package = fs.readJSONSync('./package.json');
2525
patternlab.config = config || fs.readJSONSync(path.resolve(__dirname, '../config.json'));
@@ -64,9 +64,9 @@ var patternlab_engine = function (config) {
6464
patternlab.data.link = {};
6565

6666
var pattern_assembler = new pa(),
67-
entity_encoder = new he(),
68-
pattern_exporter = new pe(),
69-
patterns_dir = paths.source.patterns;
67+
entity_encoder = new he(),
68+
pattern_exporter = new pe(),
69+
patterns_dir = paths.source.patterns;
7070

7171
pattern_assembler.combine_listItems(patternlab);
7272

@@ -166,10 +166,10 @@ var patternlab_engine = function (config) {
166166

167167
function buildFrontEnd() {
168168
var pattern_assembler = new pa(),
169-
media_hunter = new mh(),
170-
styleGuideExcludes = patternlab.config.styleGuideExcludes,
171-
styleguidePatterns = [],
172-
i; // for loops
169+
media_hunter = new mh(),
170+
styleGuideExcludes = patternlab.config.styleGuideExcludes,
171+
styleguidePatterns = [],
172+
i; // for loops
173173

174174
patternlab.buckets = [];
175175
patternlab.bucketIndex = [];
@@ -213,13 +213,13 @@ var patternlab_engine = function (config) {
213213

214214
//build the styleguide
215215
var styleguideTemplate = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'styleguide.mustache'), 'utf8'),
216-
styleguideHtml = pattern_assembler.renderPattern(styleguideTemplate, {partials: styleguidePatterns});
216+
styleguideHtml = pattern_assembler.renderPattern(styleguideTemplate, {partials: styleguidePatterns});
217217

218218
fs.outputFileSync(path.resolve(paths.public.styleguide, 'html/styleguide.html'), styleguideHtml);
219219

220220
//build the viewall pages
221221
var prevSubdir = '',
222-
prevGroup = '';
222+
prevGroup = '';
223223

224224
for (i = 0; i < patternlab.patterns.length; i++) {
225225
// skip underscore-prefixed files
@@ -238,8 +238,8 @@ var patternlab_engine = function (config) {
238238
prevGroup = pattern.patternGroup;
239239

240240
var viewAllPatterns = [],
241-
patternPartial = "viewall-" + pattern.patternGroup,
242-
j;
241+
patternPartial = "viewall-" + pattern.patternGroup,
242+
j;
243243

244244
for (j = 0; j < patternlab.patterns.length; j++) {
245245
if (patternlab.patterns[j].patternGroup === pattern.patternGroup) {
@@ -266,8 +266,8 @@ var patternlab_engine = function (config) {
266266
prevSubdir = pattern.subdir;
267267

268268
var viewAllPatterns = [],
269-
patternPartial = "viewall-" + pattern.patternGroup + "-" + pattern.patternSubGroup,
270-
j;
269+
patternPartial = "viewall-" + pattern.patternGroup + "-" + pattern.patternSubGroup,
270+
j;
271271

272272
for (j = 0; j < patternlab.patterns.length; j++) {
273273
if (patternlab.patterns[j].subdir === pattern.subdir) {

builder/patternlab_gulp.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/*
2-
* patternlab-node - v1.1.3 - 2016
3-
*
1+
/*
2+
* patternlab-node - v1.1.3 - 2016
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

1111
var patternlab_engine = require('./patternlab.js');
1212

1313
module.exports = function (gulp) {
14-
14+
1515
gulp.task('patternlab', ['clean'], function (cb) {
1616
var patternlab = patternlab_engine();
1717
patternlab.build(false);

builder/pseudopattern_hunter.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v1.1.3 - 2016
3-
*
1+
/*
2+
* patternlab-node - v1.1.3 - 2016
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

@@ -14,11 +14,11 @@ var pseudopattern_hunter = function () {
1414

1515
function findpseudopatterns(currentPattern, patternlab) {
1616
var glob = require('glob'),
17-
fs = require('fs-extra'),
18-
pa = require('./pattern_assembler'),
19-
lh = require('./lineage_hunter'),
20-
of = require('./object_factory'),
21-
path = require('path');
17+
fs = require('fs-extra'),
18+
pa = require('./pattern_assembler'),
19+
lh = require('./lineage_hunter'),
20+
of = require('./object_factory'),
21+
path = require('path');
2222

2323
var pattern_assembler = new pa();
2424
var lineage_hunter = new lh();

builder/style_modifier_hunter.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
/*
2-
* patternlab-node - v1.1.3 - 2016
3-
*
1+
/*
2+
* patternlab-node - v1.1.3 - 2016
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

11-
"use strict";
12-
13-
var style_modifier_hunter = function () {
11+
"use strict";
1412

15-
function consumestylemodifier(pattern, partial, patternlab) {
16-
//extract the classname from the stylemodifier which comes in the format of :className
17-
var styleModifier = partial.match(/:([\w\-_|])+/g) ? partial.match(/:([\w\-_|])+/g)[0].slice(1) : null;
18-
19-
if (styleModifier) {
20-
//replace the special character pipe | used to separate multiple classes with a space
21-
styleModifier = styleModifier.replace(/\|/g, ' ');
13+
var style_modifier_hunter = function () {
2214

23-
if (patternlab.config.debug) {
24-
console.log('found partial styleModifier within pattern ' + pattern.key);
25-
}
15+
function consumestylemodifier(pattern, partial, patternlab) {
16+
//extract the classname from the stylemodifier which comes in the format of :className
17+
var styleModifier = partial.match(/:([\w\-_|])+/g) ? partial.match(/:([\w\-_|])+/g)[0].slice(1) : null;
2618

27-
//replace the stylemodifier placeholder with the class name
28-
pattern.extendedTemplate = pattern.extendedTemplate.replace(/{{[ ]?styleModifier[ ]?}}/i, styleModifier);
19+
if (styleModifier) {
20+
//replace the special character pipe | used to separate multiple classes with a space
21+
styleModifier = styleModifier.replace(/\|/g, ' ');
2922

30-
//update the extendedTemplate in the partials object in case this pattern is consumed later
31-
patternlab.partials[pattern.key] = pattern.extendedTemplate;
23+
if (patternlab.config.debug) {
24+
console.log('found partial styleModifier within pattern ' + pattern.key);
3225
}
33-
}
3426

35-
return {
36-
consume_style_modifier: function (pattern, partial, patternlab) {
37-
consumestylemodifier(pattern, partial, patternlab);
38-
}
39-
};
27+
//replace the stylemodifier placeholder with the class name
28+
pattern.extendedTemplate = pattern.extendedTemplate.replace(/{{[ ]?styleModifier[ ]?}}/i, styleModifier);
4029

30+
//update the extendedTemplate in the partials object in case this pattern is consumed later
31+
patternlab.partials[pattern.key] = pattern.extendedTemplate;
32+
}
33+
}
34+
35+
return {
36+
consume_style_modifier: function (pattern, partial, patternlab) {
37+
consumestylemodifier(pattern, partial, patternlab);
38+
}
4139
};
4240

43-
module.exports = style_modifier_hunter;
41+
};
42+
43+
module.exports = style_modifier_hunter;

0 commit comments

Comments
 (0)