Skip to content

Commit

Permalink
lint: fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmk3 committed May 24, 2024
1 parent 34bdc3c commit 9945ff3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/core/scripts/build/generateServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as child_process from 'child_process'
import * as proc from 'child_process'
import * as fs from 'fs-extra'
import * as path from 'path'

Expand Down Expand Up @@ -48,7 +48,7 @@ async function cloneJsSdk(dir: string): Promise<void> {
}
const tag = `v${sdkversion}`

const gitHead = child_process.spawnSync('git', ['-C', dir, 'rev-parse', 'HEAD'])
const gitHead = proc.spawnSync('git', ['-C', dir, 'rev-parse', 'HEAD'])

const alreadyCloned = gitHead.status !== undefined && gitHead.status === 0
const msg = `${alreadyCloned ? 'Updating' : 'Cloning'} AWS JS SDK...
Expand All @@ -75,7 +75,7 @@ async function cloneJsSdk(dir: string): Promise<void> {
dir,
]

const gitCmd = child_process.execFile('git', gitArgs, { encoding: 'utf8' })
const gitCmd = proc.execFile('git', gitArgs, { encoding: 'utf8' })

gitCmd.stderr?.on('data', (data: any) => {
console.log(data)
Expand All @@ -84,7 +84,7 @@ async function cloneJsSdk(dir: string): Promise<void> {
gitCmd.stdout?.removeAllListeners()

// Only needed for the "update" case, but harmless for "clone".
const gitCheckout = child_process.spawnSync('git', [
const gitCheckout = proc.spawnSync('git', [
'-c',
'advice.detachedHead=false',
'-C',
Expand Down Expand Up @@ -164,7 +164,7 @@ async function patchServicesIntoApiMetadata(apiMetadataPath: string, serviceName
async function runTypingsGenerator(repoPath: string): Promise<void> {
console.log('Generating service client typings...')

const stdout = child_process.execFileSync('node', ['scripts/typings-generator.js'], {
const stdout = proc.execFileSync('node', ['scripts/typings-generator.js'], {
encoding: 'utf8',
cwd: repoPath,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/core/scripts/test/launchTestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as child_process from 'child_process'
import * as proc from 'child_process'
import packageJson from '../../package.json'
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath } from '@vscode/test-electron'
import { join, resolve } from 'path'
Expand Down Expand Up @@ -168,7 +168,7 @@ async function invokeVSCodeCli(vsCodeExecutablePath: string, args: string[]): Pr
}

console.log(`Invoking vscode CLI command:\n "${cli}" ${JSON.stringify(cmdArgs)}`)
const spawnResult = child_process.spawnSync(cli, cmdArgs, {
const spawnResult = proc.spawnSync(cli, cmdArgs, {
encoding: 'utf-8',
stdio: 'pipe',
})
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/accessanalyzer/vue/iamPolicyChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ async function _readCustomChecksFile(input: string): Promise<string> {
const [region, bucket, key] = parseS3Uri(input)
const s3Client = new DefaultS3Client(region)
const resp = await s3Client.getObject({ bucketName: bucket, key })
// Lint warning: this may evaluate to '[object Object]'. @typescript-eslint/no-base-to-string
// eslint-disable-next-line @typescript-eslint/no-base-to-string
return resp.objectBody.toString()
} catch (e: any) {
if (e.message.includes('Invalid S3 URI')) {
Expand Down

0 comments on commit 9945ff3

Please sign in to comment.