Skip to content

Commit

Permalink
Update @balena/lint to 8.0.0
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
myarmolinsky committed Mar 14, 2024
1 parent 6ebeb97 commit 634ad15
Show file tree
Hide file tree
Showing 44 changed files with 828 additions and 806 deletions.
2 changes: 1 addition & 1 deletion automation/build-bin.ts
Expand Up @@ -22,7 +22,7 @@ import * as archiver from 'archiver';
import * as Bluebird from 'bluebird';
import { exec, execFile } from 'child_process';
import * as filehound from 'filehound';
import { Stats } from 'fs';
import type { Stats } from 'fs';
import * as fs from 'fs-extra';
import * as klaw from 'klaw';
import * as path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion automation/capitanodoc/doc-types.d.ts
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Command as OclifCommandClass } from '@oclif/core';
import type { Command as OclifCommandClass } from '@oclif/core';

type OclifCommand = typeof OclifCommandClass;

Expand Down
2 changes: 1 addition & 1 deletion automation/capitanodoc/index.ts
Expand Up @@ -16,7 +16,7 @@
*/
import * as path from 'path';
import { getCapitanoDoc } from './capitanodoc';
import { Category, Document, OclifCommand } from './doc-types';
import type { Category, Document, OclifCommand } from './doc-types';
import * as markdown from './markdown';
import { stripIndent } from '../../lib/utils/lazy';

Expand Down
2 changes: 1 addition & 1 deletion automation/capitanodoc/markdown.ts
Expand Up @@ -20,7 +20,7 @@ import * as _ from 'lodash';

import { getManualSortCompareFunction } from '../../lib/utils/helpers';
import { capitanoizeOclifUsage } from '../../lib/utils/oclif-utils';
import { Category, Document, OclifCommand } from './doc-types';
import type { Category, Document, OclifCommand } from './doc-types';

function renderOclifCommand(command: OclifCommand): string[] {
const result = [`## ${ent.encode(command.usage || '')}`];
Expand Down
8 changes: 4 additions & 4 deletions automation/update-module.ts
Expand Up @@ -107,11 +107,11 @@ async function $main() {

const changeType = process.argv[4]
? // if the caller specified a change type, use that one
validateChangeType(process.argv[4])
validateChangeType(process.argv[4])
: // use the same change type as in the dependency, but avoid major bumps
semverChangeType && semverChangeType !== 'major'
? semverChangeType
: 'minor';
semverChangeType && semverChangeType !== 'major'
? semverChangeType
: 'minor';
console.log(`Using Change-type: ${changeType}`);

let { stdout: currentBranch } = await run('git rev-parse --abbrev-ref HEAD');
Expand Down
4 changes: 2 additions & 2 deletions automation/utils.ts
Expand Up @@ -76,8 +76,8 @@ export function diffLines(str1: string, str2: string): string {
return part.added
? prefix(part.value, '+')
: part.removed
? prefix(part.value, '-')
: prefix(part.value, ' ');
? prefix(part.value, '-')
: prefix(part.value, ' ');
})
.join('\n');
return diffStr;
Expand Down
2 changes: 1 addition & 1 deletion lib/app.ts
Expand Up @@ -16,8 +16,8 @@
*/

import * as packageJSON from '../package.json';
import type { AppOptions } from './preparser';
import {
AppOptions,
checkDeletedCommand,
preparseArgs,
unsupportedFlag,
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/api-keys/index.ts
Expand Up @@ -52,7 +52,7 @@ export default class ApiKeysCmd extends Command {
await getApplication(getBalenaSdk(), options.fleet, {
$select: 'actor',
})
).actor
).actor
: await getBalenaSdk().auth.getActorId();
const keys = await getBalenaSdk().pine.get({
resource: 'api_key',
Expand All @@ -65,7 +65,7 @@ export default class ApiKeysCmd extends Command {
name: {
$ne: null,
},
}
}
: {}),
},
$orderby: 'name asc',
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/device/index.ts
Expand Up @@ -91,7 +91,7 @@ export default class DeviceCmd extends Command {
},
...expandForAppName.$expand,
},
}
}
: {
$select: [
'device_name',
Expand All @@ -118,7 +118,7 @@ export default class DeviceCmd extends Command {
'is_undervolted',
],
...expandForAppName,
},
},
)) as ExtendedDevice;

if (options.view) {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/device/init.ts
Expand Up @@ -132,7 +132,7 @@ export default class DeviceInitCmd extends Command {
$select: 'slug',
},
},
})
})
: await (await import('../../utils/patterns')).selectApplication();

// Register new device
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/envs/index.ts
Expand Up @@ -126,7 +126,7 @@ export default class EnvsCmd extends Command {
let fleetSlug: string | undefined = options.fleet
? await (
await import('../../utils/sdk')
).getFleetSlug(balena, options.fleet)
).getFleetSlug(balena, options.fleet)
: undefined;
let fullUUID: string | undefined; // as oppposed to the short, 7-char UUID

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/logs/index.ts
Expand Up @@ -19,7 +19,7 @@ import { Flags, Args } from '@oclif/core';
import Command from '../../command';
import * as cf from '../../utils/common-flags';
import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { LogMessage } from 'balena-sdk';
import type { LogMessage } from 'balena-sdk';

const MAX_RETRY = 1000;

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/preload/index.ts
Expand Up @@ -173,7 +173,7 @@ Can be repeated to add multiple certificates.\
const fleetSlug: string | undefined = options.fleet
? await (
await import('../../utils/sdk')
).getFleetSlug(balena, options.fleet)
).getFleetSlug(balena, options.fleet)
: undefined;

const progressBars: {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/push/index.ts
Expand Up @@ -23,7 +23,7 @@ import { getBalenaSdk, stripIndent } from '../../utils/lazy';
import { dockerignoreHelp, registrySecretsHelp } from '../../utils/messages';
import type { BalenaSDK } from 'balena-sdk';
import { ExpectedError, instanceOf } from '../../errors';
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
import type { RegistrySecrets } from '@balena/compose/dist/multibuild';
import { lowercaseIfSlug } from '../../utils/normalization';
import {
applyReleaseTagKeysAndValues,
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/releases/index.ts
Expand Up @@ -78,7 +78,7 @@ export default class ReleasesCmd extends Command {
$select: ['tag_key', 'value'],
},
},
}
}
: { $select: fields },
);

Expand Down
4 changes: 2 additions & 2 deletions lib/framework/output.ts
Expand Up @@ -88,7 +88,7 @@ async function outputDataSet(
...(options.json
? {
output: 'json',
}
}
: {}),
columns: options.fields,
printLine,
Expand Down Expand Up @@ -147,7 +147,7 @@ function getLongestObjectKeyLength(o: any): number {
return Object.keys(o).length >= 1
? Object.keys(o).reduce((a, b) => {
return a.length > b.length ? a : b;
}).length
}).length
: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/compose.ts
Expand Up @@ -30,7 +30,7 @@ import type {
} from './compose-types';
import { getChalk } from './lazy';
import Logger = require('./logger');
import { ProgressCallback } from 'docker-progress';
import type { ProgressCallback } from 'docker-progress';

export function generateOpts(options: {
source?: string;
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/compose_ts.ts
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Flags } from '@oclif/core';
import { BalenaSDK } from 'balena-sdk';
import type { BalenaSDK } from 'balena-sdk';
import type { TransposeOptions } from '@balena/compose/dist/emulate';
import type * as Dockerode from 'dockerode';
import { promises as fs } from 'fs';
Expand All @@ -32,7 +32,7 @@ import * as semver from 'semver';
import type { Duplex, Readable } from 'stream';
import type { Pack } from 'tar-stream';
import { ExpectedError } from '../errors';
import {
import type {
BuiltImage,
ComposeOpts,
ComposeProject,
Expand Down
9 changes: 5 additions & 4 deletions lib/utils/device/deploy.ts
Expand Up @@ -18,13 +18,13 @@
import * as semver from 'balena-semver';
import * as Docker from 'dockerode';
import * as _ from 'lodash';
import { Composition } from '@balena/compose/dist/parse';
import {
import type { Composition } from '@balena/compose/dist/parse';
import type {
BuildTask,
getAuthConfigObj,
LocalImage,
RegistrySecrets,
} from '@balena/compose/dist/multibuild';
import { getAuthConfigObj } from '@balena/compose/dist/multibuild';
import type { Readable } from 'stream';

import { BALENA_ENGINE_TMP_PATH } from '../../config';
Expand All @@ -37,7 +37,8 @@ import {
makeImageName,
} from '../compose_ts';
import Logger = require('../logger');
import { DeviceAPI, DeviceInfo } from './api';
import type { DeviceInfo } from './api';
import { DeviceAPI } from './api';
import * as LocalPushErrors from './errors';
import LivepushManager from './live';
import { displayBuildLog } from './logs';
Expand Down
7 changes: 2 additions & 5 deletions lib/utils/device/live.ts
Expand Up @@ -30,11 +30,8 @@ import Logger = require('../logger');
import { Dockerfile } from 'livepush';
import type DeviceAPI from './api';
import type { DeviceInfo, Status } from './api';
import {
DeviceDeployOptions,
generateTargetState,
rebuildSingleTask,
} from './deploy';
import type { DeviceDeployOptions } from './deploy';
import { generateTargetState, rebuildSingleTask } from './deploy';
import { BuildError } from './errors';
import { getServiceColourFn } from './logs';
import { delay } from '../helpers';
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/device/ssh.ts
Expand Up @@ -17,11 +17,11 @@ limitations under the License.
import { ExpectedError } from '../../errors';
import { stripIndent } from '../lazy';

import type { SshRemoteCommandOpts } from '../ssh';
import {
findBestUsernameForDevice,
getRemoteCommandOutput,
runRemoteCommand,
SshRemoteCommandOpts,
} from '../ssh';

export interface DeviceSSHOpts extends SshRemoteCommandOpts {
Expand Down
12 changes: 6 additions & 6 deletions lib/utils/env-common.ts
Expand Up @@ -85,13 +85,13 @@ export function getVarResourceName(
? isConfig
? 'device_config_variable'
: isService
? 'device_service_environment_variable'
: 'device_environment_variable'
? 'device_service_environment_variable'
: 'device_environment_variable'
: isConfig
? 'application_config_variable'
: isService
? 'service_environment_variable'
: 'application_environment_variable';
? 'application_config_variable'
: isService
? 'service_environment_variable'
: 'application_environment_variable';
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/ignore.ts
Expand Up @@ -15,7 +15,8 @@
* limitations under the License.
*/
import * as _ from 'lodash';
import { promises as fs, Stats } from 'fs';
import type { Stats } from 'fs';
import { promises as fs } from 'fs';
import * as path from 'path';

import type { Ignore } from '@balena/dockerignore';
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/proxy.ts
Expand Up @@ -18,7 +18,7 @@
import type { Options as GlobalTunnelNgConfig } from 'global-tunnel-ng';
export type { GlobalTunnelNgConfig };

import { CliSettings } from './bootstrap';
import type { CliSettings } from './bootstrap';

type ProxyConfig = string | GlobalTunnelNgConfig;

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/remote-build.ts
Expand Up @@ -17,7 +17,7 @@ import type { BalenaSDK } from 'balena-sdk';
import * as JSONStream from 'JSONStream';
import * as readline from 'readline';
import * as request from 'request';
import { RegistrySecrets } from '@balena/compose/dist/multibuild';
import type { RegistrySecrets } from '@balena/compose/dist/multibuild';
import type * as Stream from 'stream';
import streamToPromise = require('stream-to-promise');
import type { Pack } from 'tar-stream';
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/ssh.ts
Expand Up @@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { spawn, StdioOptions } from 'child_process';
import type { StdioOptions } from 'child_process';
import { spawn } from 'child_process';
import * as _ from 'lodash';

import { ExpectedError } from '../errors';
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/sudo.ts
Expand Up @@ -15,7 +15,8 @@
* limitations under the License.
*/

import { ChildProcess, spawn, SpawnOptions } from 'child_process';
import type { ChildProcess, SpawnOptions } from 'child_process';
import { spawn } from 'child_process';
import { stripIndent } from './lazy';

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/tunnel.ts
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import type { BalenaSDK } from 'balena-sdk';
import { Socket } from 'net';
import type { Socket } from 'net';
import * as tls from 'tls';
import { TypedError } from 'typed-error';
import { ExpectedError } from '../errors';
Expand Down

0 comments on commit 634ad15

Please sign in to comment.