Skip to content

Commit 35ec687

Browse files
committed
Fixed eslint issues in core
1 parent 89e9ac9 commit 35ec687

File tree

6 files changed

+36
-43
lines changed

6 files changed

+36
-43
lines changed
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
export class DashboardOptions {
2-
constructor({
3-
4-
} = {}) {
5-
6-
}
72
}
83

94
export default DashboardOptions;

packages/launchpad/lib/command-center.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ export class Command {
136136
* @type {function():Promise}
137137
*/
138138
this.callback = callback;
139-
/**
139+
/**
140140
* Optional help text to display when running this app with --help
141141
* @type {string}
142142
*/
143143
this.help = help;
144-
/**
144+
/**
145145
* Execute this task on the central queue. Defaults to true.
146146
* @type {boolean}
147147
*/
@@ -169,22 +169,22 @@ export class Command {
169169
*/
170170
async run(...args) {
171171
const logger = this.logger || console;
172-
for (const cb of this.preHooks) {
172+
for (const fn of this.preHooks) {
173173
try {
174-
await cb(...args);
174+
await fn(...args);
175175
} catch (err) {
176176
logger.error(`Could not run pre-hook for command ${chalk.blue(this.name)}:`, err);
177177
}
178178
}
179-
let result = undefined;
179+
let result = null;
180180
try {
181181
result = await this.callback(...args);
182182
} catch (err) {
183183
logger.error(`Could not run command ${chalk.blue(this.name)}:`, err);
184184
}
185-
for (const cb of this.postHooks) {
185+
for (const fn of this.postHooks) {
186186
try {
187-
await cb(...args);
187+
await fn(...args);
188188
} catch (err) {
189189
logger.error(`Could not run post-hook for command ${chalk.blue(this.name)}:`, err);
190190
}
@@ -198,4 +198,4 @@ export class Command {
198198
}
199199
}
200200

201-
export default CommandCenter;
201+
export default CommandCenter;

packages/launchpad/lib/command-hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export class CommandHooks {
5353
}
5454

5555
if (key.startsWith('pre-')) {
56-
this.preHooks.push(new ExecHook({command, script}));
56+
this.preHooks.push(new ExecHook({ command, script }));
5757
} else {
58-
this.postHooks.push(new ExecHook({command, script}));
58+
this.postHooks.push(new ExecHook({ command, script }));
5959
}
6060
}
6161
}
@@ -78,4 +78,4 @@ export class ExecHook {
7878
}
7979
}
8080

81-
export default CommandHooks;
81+
export default CommandHooks;

packages/launchpad/lib/launchpad-options.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export class LaunchpadOptions {
2121
shutdownOnExit = true,
2222
...rest
2323
} = {}) {
24-
2524
/**
2625
* Will listen for exit events
2726
* @type {boolean}
@@ -47,8 +46,8 @@ export class LaunchpadOptions {
4746
/**
4847
* @type {CommandHooks}
4948
*/
50-
this.hooks = new CommandHooks(hooks);
51-
49+
this.hooks = new CommandHooks(hooks);
50+
5251
/**
5352
* @type {LogOptions}
5453
*/

packages/launchpad/test/config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { getConfig as getContentConfig } from '@bluecadet/launchpad-content/test
22
import { getConfig as getMonitorConfig } from '@bluecadet/launchpad-monitor/test/test.js';
33

44
const config = {
5-
"content": await getContentConfig(),
6-
"monitor": await getMonitorConfig(),
7-
"logging": {
8-
"level": "debug"
5+
content: await getContentConfig(),
6+
monitor: await getMonitorConfig(),
7+
logging: {
8+
level: 'debug'
99
},
10-
"commands": {
11-
"concurrency": 1
12-
}
10+
commands: {
11+
concurrency: 1
12+
}
1313
};
1414

15-
export default config;
15+
export default config;

packages/launchpad/test/test.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { ConfigManager, launchFromCli, onExit } from '@bluecadet/launchpad-utils
33

44
const getConfig = async (paths = ['user-config.js', 'config.js']) => {
55
return ConfigManager.importJsConfig(paths, import.meta);
6-
}
6+
};
77

88
const wait = async (seconds) => {
99
console.debug(`Waiting for ${seconds}s...`);
1010
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
11-
}
11+
};
1212

1313
launchFromCli(import.meta, {
1414
userConfig: await getConfig()
@@ -17,25 +17,24 @@ launchFromCli(import.meta, {
1717

1818
await launchpad.startup();
1919

20-
// const appNames = launchpad._monitor.getAllAppNames();
21-
// await Promise.all([...appNames, 'fake-app'].map(async (appName) => {
22-
// const isRunning = await launchpad._monitor.isRunning(appName);
23-
// console.debug(`App '${appName}' is running: ${isRunning}`);
24-
// }));
20+
const appNames = launchpad._monitor.getAllAppNames();
21+
await Promise.all([...appNames, 'fake-app'].map(async (appName) => {
22+
const isRunning = await launchpad._monitor.isRunning(appName);
23+
console.debug(`App '${appName}' is running: ${isRunning}`);
24+
}));
2525

26-
// onExit(async () => {
27-
// await launchpad.shutdown();
28-
// });
26+
onExit(async () => {
27+
await launchpad.shutdown();
28+
});
2929

30-
// await wait(10);
31-
// await launchpad.updateContent();
32-
33-
// await wait(10);
34-
// await launchpad.shutdown();
30+
await wait(10);
31+
await launchpad.updateContent();
3532

33+
await wait(10);
34+
await launchpad.shutdown();
3635
}).catch(err => {
3736
if (err) {
3837
console.error('Launch error', err);
3938
throw err;
4039
}
41-
});
40+
});

0 commit comments

Comments
 (0)