Skip to content

Commit b2fc9e4

Browse files
Merge pull request #707 from bryceosterhaus/14
2 parents f25c0c4 + 79c0f29 commit b2fc9e4

File tree

78 files changed

+202
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+202
-175
lines changed

maintenance/projects/js-themes-toolkit-v8-x/packages/generator-liferay-theme/generators/themelet/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ module.exports = class extends Base {
8282
return prompts.reduce((result, item) => {
8383
const name = item.name;
8484

85-
if (name == 'themeName') {
85+
if (name === 'themeName') {
8686
item.default = 'My Liferay Themelet';
8787
item.message = 'What would you like to call your themelet?';
8888
}
89-
else if (name == 'themeId') {
89+
else if (name === 'themeId') {
9090
item.message = 'Would you like to use this as the themeletId?';
9191
}
92-
else if (name == 'liferayVersion') {
92+
else if (name === 'liferayVersion') {
9393
item.choices = ['7.1', '7.0', 'All'];
9494
item.message = 'Which version of Liferay is this themelet for?';
9595
}
@@ -107,7 +107,7 @@ module.exports = class extends Base {
107107
}
108108

109109
_promptCallback(props) {
110-
if (props.liferayVersion == 'All') {
110+
if (props.liferayVersion === 'All') {
111111
props.liferayVersion = '*';
112112
}
113113
super._promptCallback.call(this, props);

maintenance/projects/js-themes-toolkit-v8-x/packages/generator-liferay-theme/lib/__tests__/layout_creator.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ describe('LayoutCreator', () => {
509509
_.forEach(choices, (choice, index) => {
510510
index = index + 1;
511511

512-
if (index % 2 == 0) {
512+
if (index % 2 === 0) {
513513
assert.equal(choice.type, 'separator');
514514
assert.equal(
515515
stripAnsi(choice.line),
@@ -527,7 +527,7 @@ describe('LayoutCreator', () => {
527527
}
528528
});
529529

530-
assert(choices[choices.length - 1].type != 'separator');
530+
assert(choices[choices.length - 1].type !== 'separator');
531531

532532
while (prototype.rows.length < 7) {
533533
prototype.rows.push({
@@ -569,7 +569,7 @@ describe('LayoutCreator', () => {
569569
_.forEach(choices, (choice, index) => {
570570
index = index + 1;
571571

572-
if (index % 2 == 0) {
572+
if (index % 2 === 0) {
573573
assert.equal(choice.value, choiceValue);
574574
assert.equal(
575575
stripAnsi(choice.name),
@@ -587,7 +587,7 @@ describe('LayoutCreator', () => {
587587
}
588588
});
589589

590-
assert(choices[choices.length - 1].type == 'separator');
590+
assert(choices[choices.length - 1].type === 'separator');
591591

592592
while (prototype.rows.length < 7) {
593593
prototype.rows.push({

maintenance/projects/js-themes-toolkit-v8-x/packages/generator-liferay-theme/lib/layout_creator.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ inquirer.prompt.prompts.list.prototype.render = function () {
2929
var choices = _.reduce(
3030
this.opt.choices.choices,
3131
(result, item) => {
32-
if (item.type != 'separator') {
32+
if (item.type !== 'separator') {
3333
result.push(item);
3434
}
3535

@@ -113,16 +113,16 @@ LayoutCreator.prototype = {
113113
_afterPromptFinishRow(answers, cb) {
114114
var finish = answers.finish;
115115

116-
if (finish == 'add') {
116+
if (finish === 'add') {
117117
this._promptRow(cb);
118118
}
119-
else if (finish == 'insert') {
119+
else if (finish === 'insert') {
120120
this._promptInsertRow(cb);
121121
}
122-
else if (answers.finish == 'finish') {
122+
else if (answers.finish === 'finish') {
123123
cb(null);
124124
}
125-
else if (finish == 'remove') {
125+
else if (finish === 'remove') {
126126
this._promptRemoveRow(cb);
127127
}
128128
},

maintenance/projects/js-themes-toolkit-v8-x/packages/liferay-theme-tasks/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function register(options) {
5151
store.set('changedFile');
5252

5353
globby.sync([path.resolve(__dirname, 'tasks/**/*')]).forEach((item) => {
54-
if (item.indexOf('__tests__') == -1) {
54+
if (item.indexOf('__tests__') === -1) {
5555
// eslint-disable-next-line @liferay/no-dynamic-require
5656
require(item)(options);
5757
}

maintenance/projects/js-themes-toolkit-v8-x/packages/liferay-theme-tasks/lib/lookup/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function isLanguage(version) {
3636

3737
function printWarnings(version) {
3838
return function (generator, {templateLanguage}) {
39-
if (templateLanguage == 'vm') {
39+
if (templateLanguage === 'vm') {
4040
if (version === '7.0') {
4141
generator.log(
4242
chalk.yellow(

maintenance/projects/js-themes-toolkit-v8-x/packages/liferay-theme-tasks/lib/prompts/__tests__/prompt_util.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ it('formatThemeletSelection should format themelet selection retrieved from getM
5858
it('getListType should get listType based on environment', () => {
5959
const listType = promptUtil.getListType();
6060

61-
expect(listType == 'list' || listType == 'rawlist').toBe(true);
61+
expect(listType === 'list' || listType === 'rawlist').toBe(true);
6262
});
6363

6464
it('getModuleChoices should get module choices that are appropriate for extend type', () => {
@@ -80,7 +80,7 @@ it('getModuleChoices should get module choices that are appropriate for extend t
8080
const number = index + 1;
8181
const name = 'themelet-' + number;
8282

83-
if (number == 1) {
83+
if (number === 1) {
8484
expect(item.name).toBe(name + ' (selected)');
8585
}
8686

@@ -108,7 +108,7 @@ it('getModuleChoices should get module choices that are appropriate for extend t
108108
const number = index + 1;
109109
const name = 'themelet-' + number;
110110

111-
if (number == 1) {
111+
if (number === 1) {
112112
expect(item.checked).toBe(true);
113113
}
114114
else {

maintenance/projects/js-themes-toolkit-v8-x/packages/liferay-theme-tasks/test/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ expect.extend({
4646
pass = false;
4747
message = `Path '${path}' is not a folder`;
4848
}
49-
else if (fs.readdirSync(path).length == 0) {
49+
else if (fs.readdirSync(path).length === 0) {
5050
pass = false;
5151
message = `Folder '${path}' is empty`;
5252
}
@@ -70,7 +70,7 @@ expect.extend({
7070
pass = false;
7171
message = `Path '${path}' is not a folder`;
7272
}
73-
else if (fs.readdirSync(path).length != 0) {
73+
else if (fs.readdirSync(path).length !== 0) {
7474
pass = false;
7575
message = `Folder '${path}' is not empty`;
7676
}
@@ -321,7 +321,7 @@ function cleanTempTheme(themeName, version, component, initCwd) {
321321

322322
cleanDirectory(tempPath);
323323

324-
if (initCwd != null) {
324+
if (initCwd !== null && initCwd !== undefined) {
325325
process.chdir(initCwd);
326326
}
327327
}

maintenance/projects/js-themes-toolkit-v9-x/packages/generator-liferay-theme/lib/LayoutCreator.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ inquirer.prompt.prompts.list.prototype.render = function () {
2929
var choices = _.reduce(
3030
this.opt.choices.choices,
3131
(result, item) => {
32-
if (item.type != 'separator') {
32+
if (item.type !== 'separator') {
3333
result.push(item);
3434
}
3535

@@ -106,16 +106,16 @@ LayoutCreator.prototype = {
106106
_afterPromptFinishRow(answers, cb) {
107107
var finish = answers.finish;
108108

109-
if (finish == 'add') {
109+
if (finish === 'add') {
110110
this._promptRow(cb);
111111
}
112-
else if (finish == 'insert') {
112+
else if (finish === 'insert') {
113113
this._promptInsertRow(cb);
114114
}
115-
else if (answers.finish == 'finish') {
115+
else if (answers.finish === 'finish') {
116116
cb(null);
117117
}
118-
else if (finish == 'remove') {
118+
else if (finish === 'remove') {
119119
this._promptRemoveRow(cb);
120120
}
121121
},

maintenance/projects/js-themes-toolkit-v9-x/packages/generator-liferay-theme/lib/__tests__/LayoutCreator.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ describe('LayoutCreator', () => {
500500
_.forEach(choices, (choice, index) => {
501501
index = index + 1;
502502

503-
if (index % 2 == 0) {
503+
if (index % 2 === 0) {
504504
assert.equal(choice.type, 'separator');
505505
assert.equal(
506506
stripAnsi(choice.line),
@@ -518,7 +518,7 @@ describe('LayoutCreator', () => {
518518
}
519519
});
520520

521-
assert(choices[choices.length - 1].type != 'separator');
521+
assert(choices[choices.length - 1].type !== 'separator');
522522

523523
while (prototype.rows.length < 7) {
524524
prototype.rows.push({
@@ -560,7 +560,7 @@ describe('LayoutCreator', () => {
560560
_.forEach(choices, (choice, index) => {
561561
index = index + 1;
562562

563-
if (index % 2 == 0) {
563+
if (index % 2 === 0) {
564564
assert.equal(choice.value, choiceValue);
565565
assert.equal(
566566
stripAnsi(choice.name),
@@ -578,7 +578,7 @@ describe('LayoutCreator', () => {
578578
}
579579
});
580580

581-
assert(choices[choices.length - 1].type == 'separator');
581+
assert(choices[choices.length - 1].type === 'separator');
582582

583583
while (prototype.rows.length < 7) {
584584
prototype.rows.push({

maintenance/projects/js-themes-toolkit-v9-x/packages/liferay-theme-tasks/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function register(options) {
4747
store.set('changedFile');
4848

4949
globby.sync([path.resolve(__dirname, 'tasks/**/*')]).forEach((item) => {
50-
if (item.indexOf('__tests__') == -1) {
50+
if (item.indexOf('__tests__') === -1) {
5151
// eslint-disable-next-line @liferay/no-dynamic-require
5252
require(item)(options);
5353
}

0 commit comments

Comments
 (0)