Skip to content

Commit 76fc53a

Browse files
authored
chore: Fix linting errors (#1441)
1 parent ffe7e32 commit 76fc53a

File tree

19 files changed

+243
-86
lines changed

19 files changed

+243
-86
lines changed

commands/account/clean.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import SpinniesManager from '../../lib/ui/SpinniesManager';
1717
import { uiAccountDescription } from '../../lib/ui';
1818
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
1919

20-
2120
export const command = 'clean';
2221
export const describe = i18n(`commands.account.subcommands.clean.describe`);
2322

commands/account/info.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { i18n } from '../../lib/lang';
77
import { getTableContents } from '../../lib/ui/table';
88
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
99

10-
1110
export const describe = i18n(`commands.account.subcommands.info.describe`);
1211
export const command = 'info [account]';
1312

@@ -32,24 +31,41 @@ export async function handler(
3231
scopeGroups = response.scopeGroups.map(s => [s]);
3332

3433
logger.log(i18n(`commands.account.subcommands.info.name`, { name: name! }));
35-
logger.log(i18n(`commands.account.subcommands.info.accountId`, { accountId: derivedAccountId }));
34+
logger.log(
35+
i18n(`commands.account.subcommands.info.accountId`, {
36+
accountId: derivedAccountId,
37+
})
38+
);
3639
logger.log(i18n(`commands.account.subcommands.info.scopeGroups`));
3740
logger.log(getTableContents(scopeGroups, { border: { bodyLeft: ' ' } }));
3841
} else {
39-
logger.log(i18n(`commands.account.subcommands.info.errors.notUsingPersonalAccessKey`));
42+
logger.log(
43+
i18n(`commands.account.subcommands.info.errors.notUsingPersonalAccessKey`)
44+
);
4045
}
4146
}
4247

4348
function accountInfoBuilder(yargs: Argv): Argv<AccountInfoArgs> {
4449
yargs.positional('account', {
45-
describe: i18n(`commands.account.subcommands.info.options.account.describe`),
50+
describe: i18n(
51+
`commands.account.subcommands.info.options.account.describe`
52+
),
4653
type: 'string',
4754
});
4855

4956
yargs.example([
50-
['$0 accounts info', i18n(`commands.account.subcommands.info.examples.default`)],
51-
['$0 accounts info MyAccount', i18n(`commands.account.subcommands.info.examples.nameBased`)],
52-
['$0 accounts info 1234567', i18n(`commands.account.subcommands.info.examples.idBased`)],
57+
[
58+
'$0 accounts info',
59+
i18n(`commands.account.subcommands.info.examples.default`),
60+
],
61+
[
62+
'$0 accounts info MyAccount',
63+
i18n(`commands.account.subcommands.info.examples.nameBased`),
64+
],
65+
[
66+
'$0 accounts info 1234567',
67+
i18n(`commands.account.subcommands.info.examples.idBased`),
68+
],
5369
]);
5470

5571
return yargs as Argv<AccountInfoArgs>;

commands/account/list.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ export async function handler(
112112
])
113113
);
114114

115-
logger.log(i18n('commands.account.subcommands.list.configPath', { configPath: configPath! }));
115+
logger.log(
116+
i18n('commands.account.subcommands.list.configPath', {
117+
configPath: configPath!,
118+
})
119+
);
116120
logger.log(
117121
i18n('commands.account.subcommands.list.defaultAccount', {
118122
account: getConfigDefaultAccount()!,

commands/account/remove.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { selectAccountFromConfig } from '../../lib/prompts/accountsPrompt';
1414
import { addConfigOptions } from '../../lib/commonOpts';
1515
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
1616

17-
1817
export const command = 'remove [account]';
1918
export const describe = i18n(`commands.account.subcommands.remove.describe`);
2019

@@ -64,7 +63,9 @@ export async function handler(
6463

6564
if (accountToRemove === currentDefaultAccount) {
6665
logger.log();
67-
logger.log(i18n(`commands.account.subcommands.remove.logs.replaceDefaultAccount`));
66+
logger.log(
67+
i18n(`commands.account.subcommands.remove.logs.replaceDefaultAccount`)
68+
);
6869
const newDefaultAccount = await selectAccountFromConfig();
6970
updateDefaultAccount(newDefaultAccount);
7071
}
@@ -74,13 +75,21 @@ export function builder(yargs: Argv): Argv<AccountRemoveArgs> {
7475
addConfigOptions(yargs);
7576

7677
yargs.positional('account', {
77-
describe: i18n(`commands.account.subcommands.remove.options.account.describe`),
78+
describe: i18n(
79+
`commands.account.subcommands.remove.options.account.describe`
80+
),
7881
type: 'string',
7982
});
8083

8184
yargs.example([
82-
['$0 accounts remove', i18n(`commands.account.subcommands.remove.examples.default`)],
83-
['$0 accounts remove MyAccount', i18n(`commands.account.subcommands.remove.examples.byName`)],
85+
[
86+
'$0 accounts remove',
87+
i18n(`commands.account.subcommands.remove.examples.default`),
88+
],
89+
[
90+
'$0 accounts remove MyAccount',
91+
i18n(`commands.account.subcommands.remove.examples.byName`),
92+
],
8493
]);
8594

8695
return yargs as Argv<AccountRemoveArgs>;

commands/account/rename.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { CommonArgs, ConfigArgs } from '../../types/Yargs';
88
import { logError } from '../../lib/errorHandlers';
99
import { EXIT_CODES } from '../../lib/enums/exitCodes';
1010

11-
1211
export const command = 'rename <account-name> <new-name>';
1312
export const describe = i18n(`commands.account.subcommands.rename.describe`);
1413

@@ -46,11 +45,15 @@ export function builder(yargs: Argv): Argv<AccountRenameArgs> {
4645
addAccountOptions(yargs);
4746

4847
yargs.positional('account-name', {
49-
describe: i18n(`commands.account.subcommands.rename.positionals.accountName.describe`),
48+
describe: i18n(
49+
`commands.account.subcommands.rename.positionals.accountName.describe`
50+
),
5051
type: 'string',
5152
});
5253
yargs.positional('new-name', {
53-
describe: i18n(`commands.account.subcommands.rename.positionals.newName.describe`),
54+
describe: i18n(
55+
`commands.account.subcommands.rename.positionals.newName.describe`
56+
),
5457
type: 'string',
5558
});
5659

commands/account/use.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,18 @@ export function builder(yargs: Argv): Argv<AccountUseArgs> {
5656
});
5757

5858
yargs.example([
59-
['$0 accounts use', i18n('commands.account.subcommands.use.examples.default')],
60-
['$0 accounts use MyAccount', i18n('commands.account.subcommands.use.examples.nameBased')],
61-
['$0 accounts use 1234567', i18n('commands.account.subcommands.use.examples.idBased')],
59+
[
60+
'$0 accounts use',
61+
i18n('commands.account.subcommands.use.examples.default'),
62+
],
63+
[
64+
'$0 accounts use MyAccount',
65+
i18n('commands.account.subcommands.use.examples.nameBased'),
66+
],
67+
[
68+
'$0 accounts use 1234567',
69+
i18n('commands.account.subcommands.use.examples.idBased'),
70+
],
6271
]);
6372

6473
return yargs as Argv<AccountUseArgs>;

commands/cms/getReactModule.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const { trackCommandUsage } = require('../../lib/usageTracking');
1010
const { listPrompt } = require('../../lib/prompts/promptUtils');
1111
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
1212

13-
1413
exports.command = 'get-react-module [name] [dest]';
1514
exports.describe = i18n(`commands.cms.subcommands.getReactModule.describe`);
1615

@@ -62,7 +61,9 @@ exports.handler = async options => {
6261
);
6362
} catch (e) {
6463
if (e.cause && e.cause.code === 'ERR_BAD_REQUEST') {
65-
logger.error(i18n(`commands.cms.subcommands.getReactModule.errors.invalidName`));
64+
logger.error(
65+
i18n(`commands.cms.subcommands.getReactModule.errors.invalidName`)
66+
);
6667
} else {
6768
logError(e);
6869
}
@@ -72,11 +73,15 @@ exports.handler = async options => {
7273

7374
exports.builder = yargs => {
7475
yargs.positional('name', {
75-
describe: i18n(`commands.cms.subcommands.getReactModule.positionals.name.describe`),
76+
describe: i18n(
77+
`commands.cms.subcommands.getReactModule.positionals.name.describe`
78+
),
7679
type: 'string',
7780
});
7881
yargs.positional('dest', {
79-
describe: i18n(`commands.cms.subcommands.getReactModule.positionals.dest.describe`),
82+
describe: i18n(
83+
`commands.cms.subcommands.getReactModule.positionals.dest.describe`
84+
),
8085
type: 'string',
8186
});
8287
return yargs;

commands/cms/lighthouseScore.ts

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const { HUBSPOT_FOLDER, MARKETPLACE_FOLDER } = require('../../lib/constants');
1919
const { uiLink } = require('../../lib/ui');
2020
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
2121

22-
2322
const DEFAULT_TABLE_HEADER = [
2423
'Accessibility',
2524
'Best practices',
@@ -37,7 +36,9 @@ const selectTheme = async accountId => {
3736
type: 'list',
3837
look: false,
3938
name: 'theme',
40-
message: i18n(`commands.cms.subcommands.lighthouseScore.info.promptMessage`),
39+
message: i18n(
40+
`commands.cms.subcommands.lighthouseScore.info.promptMessage`
41+
),
4142
choices: async () => {
4243
try {
4344
const { data: result } = await fetchThemes(accountId, {
@@ -54,7 +55,11 @@ const selectTheme = async accountId => {
5455
);
5556
}
5657
} catch (err) {
57-
logger.error(i18n(`commands.cms.subcommands.lighthouseScore.errors.failedToFetchThemes`));
58+
logger.error(
59+
i18n(
60+
`commands.cms.subcommands.lighthouseScore.errors.failedToFetchThemes`
61+
)
62+
);
5863
process.exit(EXIT_CODES.ERROR);
5964
}
6065
},
@@ -83,7 +88,9 @@ exports.handler = async options => {
8388
}
8489
if (!isValidTheme) {
8590
logger.error(
86-
i18n(`commands.cms.subcommands.lighthouseScore.errors.themeNotFound`, { theme: themeToCheck })
91+
i18n(`commands.cms.subcommands.lighthouseScore.errors.themeNotFound`, {
92+
theme: themeToCheck,
93+
})
8794
);
8895
process.exit(EXIT_CODES.ERROR);
8996
}
@@ -104,7 +111,11 @@ exports.handler = async options => {
104111
}
105112

106113
if (!requestResult || !requestResult.mobileId || !requestResult.desktopId) {
107-
logger.error(i18n(`commands.cms.subcommands.lighthouseScore.errors.failedToGetLighthouseScore`));
114+
logger.error(
115+
i18n(
116+
`commands.cms.subcommands.lighthouseScore.errors.failedToGetLighthouseScore`
117+
)
118+
);
108119
process.exit(EXIT_CODES.ERROR);
109120
}
110121

@@ -113,7 +124,10 @@ exports.handler = async options => {
113124
SpinniesManager.init();
114125

115126
SpinniesManager.add('lighthouseScore', {
116-
text: i18n(`commands.cms.subcommands.lighthouseScore.info.generatingScore`, { theme: themeToCheck }),
127+
text: i18n(
128+
`commands.cms.subcommands.lighthouseScore.info.generatingScore`,
129+
{ theme: themeToCheck }
130+
),
117131
});
118132

119133
const checkScoreStatus = async () => {
@@ -183,7 +197,11 @@ exports.handler = async options => {
183197
verboseViewAverageScoreResult = data;
184198
}
185199
} catch (err) {
186-
logger.error(i18n(`commands.cms.subcommands.lighthouseScore.errors.failedToGetLighthouseScore`));
200+
logger.error(
201+
i18n(
202+
`commands.cms.subcommands.lighthouseScore.errors.failedToGetLighthouseScore`
203+
)
204+
);
187205
process.exit(EXIT_CODES.ERROR);
188206
}
189207

@@ -209,7 +227,11 @@ exports.handler = async options => {
209227
border: { bodyLeft: ' ' },
210228
})
211229
);
212-
logger.log(i18n(`commands.cms.subcommands.lighthouseScore.info.pageTemplateScoreTitle`));
230+
logger.log(
231+
i18n(
232+
`commands.cms.subcommands.lighthouseScore.info.pageTemplateScoreTitle`
233+
)
234+
);
213235

214236
const table2Header = getTableHeader([
215237
'Template path',
@@ -236,22 +258,32 @@ exports.handler = async options => {
236258
})
237259
);
238260

239-
logger.log(i18n(`commands.cms.subcommands.lighthouseScore.info.lighthouseLinksTitle`));
261+
logger.log(
262+
i18n(`commands.cms.subcommands.lighthouseScore.info.lighthouseLinksTitle`)
263+
);
240264

241265
scoreResult.scores.forEach(score => {
242266
logger.log(' ', uiLink(score.templatePath, score.link));
243267
});
244268

245269
if (scoreResult.failedTemplatePaths.length) {
246270
logger.log();
247-
logger.error(i18n(`commands.cms.subcommands.lighthouseScore.info.failedTemplatePathsTitle`));
271+
logger.error(
272+
i18n(
273+
`commands.cms.subcommands.lighthouseScore.info.failedTemplatePathsTitle`
274+
)
275+
);
248276
scoreResult.failedTemplatePaths.forEach(failedTemplatePath => {
249277
logger.log(' ', failedTemplatePath);
250278
});
251279
}
252280

253281
logger.log();
254-
logger.info(i18n(`commands.cms.subcommands.lighthouseScore.info.targetDeviceNote`, { target }));
282+
logger.info(
283+
i18n(`commands.cms.subcommands.lighthouseScore.info.targetDeviceNote`, {
284+
target,
285+
})
286+
);
255287
} else {
256288
logger.log(`Theme: ${themeToCheck}`);
257289
const tableHeader = getTableHeader(['Target', ...DEFAULT_TABLE_HEADER]);
@@ -279,7 +311,9 @@ exports.handler = async options => {
279311
})
280312
);
281313

282-
logger.info(i18n(`commands.cms.subcommands.lighthouseScore.info.verboseOptionNote`));
314+
logger.info(
315+
i18n(`commands.cms.subcommands.lighthouseScore.info.verboseOptionNote`)
316+
);
283317
}
284318

285319
logger.log();
@@ -295,17 +329,23 @@ exports.handler = async options => {
295329

296330
exports.builder = yargs => {
297331
yargs.option('theme', {
298-
describe: i18n(`commands.cms.subcommands.lighthouseScore.options.theme.describe`),
332+
describe: i18n(
333+
`commands.cms.subcommands.lighthouseScore.options.theme.describe`
334+
),
299335
type: 'string',
300336
});
301337
yargs.option('target', {
302-
describe: i18n(`commands.cms.subcommands.lighthouseScore.options.target.describe`),
338+
describe: i18n(
339+
`commands.cms.subcommands.lighthouseScore.options.target.describe`
340+
),
303341
type: 'string',
304342
choices: ['desktop', 'mobile'],
305343
default: 'desktop',
306344
});
307345
yargs.option('verbose', {
308-
describe: i18n(`commands.cms.subcommands.lighthouseScore.options.verbose.describe`),
346+
describe: i18n(
347+
`commands.cms.subcommands.lighthouseScore.options.verbose.describe`
348+
),
309349
boolean: true,
310350
default: false,
311351
});

0 commit comments

Comments
 (0)