From b39ab442ba45277c19cb26e29de0146c368b8006 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Tue, 23 Jul 2019 12:09:08 +0100 Subject: [PATCH] Fix type checker, linter and prettier errors to allow backport changes Change-type: patch Signed-off-by: Paulo Castro --- automation/build-bin.ts | 2 +- automation/capitanodoc/utils.ts | 4 +--- lib/actions/environment-variables.ts | 4 +--- lib/actions/push.ts | 4 +--- lib/actions/tunnel.ts | 4 +--- lib/utils/compose_ts.ts | 8 ++------ lib/utils/device/deploy.ts | 8 ++------ lib/utils/helpers.ts | 8 ++------ lib/utils/remote-build.ts | 4 +--- 9 files changed, 12 insertions(+), 34 deletions(-) diff --git a/automation/build-bin.ts b/automation/build-bin.ts index 506dd536..387f1ba6 100755 --- a/automation/build-bin.ts +++ b/automation/build-bin.ts @@ -51,7 +51,7 @@ execPkg(['--target', 'host', '--output', 'build-bin/balena', 'package.json']) .then(nativeExtensions => { console.log(`\nCopying to build-bin:\n${nativeExtensions.join('\n')}`); - return nativeExtensions.map(extPath => { + return nativeExtensions.map((extPath: string) => { return fs.copy( extPath, extPath.replace( diff --git a/automation/capitanodoc/utils.ts b/automation/capitanodoc/utils.ts index 060cf6f8..c30e5167 100644 --- a/automation/capitanodoc/utils.ts +++ b/automation/capitanodoc/utils.ts @@ -126,9 +126,7 @@ export class MarkdownFileParser { } else { reject( new Error( - `Markdown section not found: title="${title}" file="${ - this.mdFilePath - }"`, + `Markdown section not found: title="${title}" file="${this.mdFilePath}"`, ), ); } diff --git a/lib/actions/environment-variables.ts b/lib/actions/environment-variables.ts index 03b12df7..461509d8 100644 --- a/lib/actions/environment-variables.ts +++ b/lib/actions/environment-variables.ts @@ -223,9 +223,7 @@ export const add: CommandDefinition< throw new Error(`Environment value not found for key: ${params.key}`); } else { console.info( - `Warning: using ${params.key}=${ - params.value - } from host environment`, + `Warning: using ${params.key}=${params.value} from host environment`, ); } } diff --git a/lib/actions/push.ts b/lib/actions/push.ts index 593148be..35019549 100644 --- a/lib/actions/push.ts +++ b/lib/actions/push.ts @@ -88,9 +88,7 @@ async function getAppOwner(sdk: BalenaSDK, appName: string) { }); const selected = await selectFromList( - `${ - entries.length - } applications found with that name, please select the application you would like to push to`, + `${entries.length} applications found with that name, please select the application you would like to push to`, entries, ); diff --git a/lib/actions/tunnel.ts b/lib/actions/tunnel.ts index 7080cb52..62d0c72b 100644 --- a/lib/actions/tunnel.ts +++ b/lib/actions/tunnel.ts @@ -212,9 +212,7 @@ export const tunnel: CommandDefinition = { ) .then(() => { logger.logInfo( - ` - tunnelling ${localAddress}:${localPort} to ${ - device.uuid - }:${remotePort}`, + ` - tunnelling ${localAddress}:${localPort} to ${device.uuid}:${remotePort}`, ); return true; diff --git a/lib/utils/compose_ts.ts b/lib/utils/compose_ts.ts index d25d67ef..b20b5d48 100644 --- a/lib/utils/compose_ts.ts +++ b/lib/utils/compose_ts.ts @@ -51,9 +51,7 @@ export async function parseRegistrySecrets( return registrySecrets; } catch (error) { return exitWithExpectedError( - `Error validating registry secrets file "${secretsFilename}":\n${ - error.message - }`, + `Error validating registry secrets file "${secretsFilename}":\n${error.message}`, ); } } @@ -144,9 +142,7 @@ async function performResolution( buildTask.buildStream = clonedStream; if (!buildTask.external && !buildTask.resolved) { throw new Error( - `Project type for service "${ - buildTask.serviceName - }" could not be determined. Missing a Dockerfile?`, + `Project type for service "${buildTask.serviceName}" could not be determined. Missing a Dockerfile?`, ); } return buildTask; diff --git a/lib/utils/device/deploy.ts b/lib/utils/device/deploy.ts index 7beec4b6..5de05893 100644 --- a/lib/utils/device/deploy.ts +++ b/lib/utils/device/deploy.ts @@ -92,9 +92,7 @@ async function environmentFromInput( // exists if (!(match[1] in ret)) { logger.logDebug( - `Warning: Cannot find a service with name ${ - match[1] - }. Treating the string as part of the environment variable name.`, + `Warning: Cannot find a service with name ${match[1]}. Treating the string as part of the environment variable name.`, ); match[2] = `${match[1]}:${match[2]}`; } else { @@ -132,9 +130,7 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise { await api.ping(); } catch (e) { exitWithExpectedError( - `Could not communicate with local mode device at address ${ - opts.deviceHost - }`, + `Could not communicate with local mode device at address ${opts.deviceHost}`, ); } diff --git a/lib/utils/helpers.ts b/lib/utils/helpers.ts index a387a488..3edbe078 100644 --- a/lib/utils/helpers.ts +++ b/lib/utils/helpers.ts @@ -45,13 +45,9 @@ export function stateToString(state: OperationState) { switch (state.operation.command) { case 'copy': - return `${result} ${state.operation.from.path} -> ${ - state.operation.to.path - }`; + return `${result} ${state.operation.from.path} -> ${state.operation.to.path}`; case 'replace': - return `${result} ${state.operation.file.path}, ${ - state.operation.copy - } -> ${state.operation.replace}`; + return `${result} ${state.operation.file.path}, ${state.operation.copy} -> ${state.operation.replace}`; case 'run-script': return `${result} ${state.operation.script}`; default: diff --git a/lib/utils/remote-build.ts b/lib/utils/remote-build.ts index 9854ce96..75f127d7 100644 --- a/lib/utils/remote-build.ts +++ b/lib/utils/remote-build.ts @@ -279,9 +279,7 @@ function createRemoteBuildRequest( if (response.statusCode >= 100 && response.statusCode < 400) { if (DEBUG_MODE) { console.log( - `[debug] received HTTP ${response.statusCode} ${ - response.statusMessage - }`, + `[debug] received HTTP ${response.statusCode} ${response.statusMessage}`, ); } } else {