Skip to content

Commit 9216ca4

Browse files
committed
eslint issues
1 parent c3efd23 commit 9216ca4

File tree

11 files changed

+17
-15
lines changed

11 files changed

+17
-15
lines changed

packages/app-builder-lib/src/codeSign/macCodeSign.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async function importCerts(keychainFile: string, paths: Array<string>, keyPasswo
212212
}
213213
}
214214

215-
export async function sign(opts: SignOptions): Promise<void> {
215+
export function sign(opts: SignOptions): Promise<void> {
216216
return retry(() => signAsync(opts), 3, 5000, 5000)
217217
}
218218

packages/app-builder-lib/src/electron/electronVersion.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@ export async function computeElectronVersion(projectDir: string): Promise<string
7575
accept: "application/xml, application/atom+xml, text/xml, */*",
7676
},
7777
})
78-
const feed = parseXml(feedXml!)
78+
const feed = parseXml(feedXml)
7979
const latestRelease = feed.element("entry", false, `No published versions on GitHub`)
8080
const v = /\/tag\/v?([^/]+)$/.exec(latestRelease.element("link").attribute("href"))![1]
8181
return v.startsWith("v") ? v.substring(1) : v
8282
} else if (dependency?.version === "latest") {
8383
log.warn('Electron version is set to "latest", but it is recommended to set it to some more restricted version range.')
8484
try {
8585
const releaseInfo = JSON.parse(
86-
(await httpExecutor.request({
86+
await httpExecutor.request({
8787
hostname: "github.com",
8888
path: `/electron/${dependency.name === "electron-nightly" ? "nightlies" : "electron"}/releases/latest`,
8989
headers: {
9090
accept: "application/json",
9191
},
92-
}))!
92+
})
9393
)
9494
const version = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name
9595
log.info({ version }, `resolve ${dependency.name}@${dependency.version}`)

packages/app-builder-lib/src/targets/differentialUpdateInfoBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function createNsisWebDifferentialUpdateInfo(artifactPath: string, packag
2727
path: file,
2828
// https://github.com/electron-userland/electron-builder/issues/2583
2929
file,
30-
} as any
30+
}
3131
}
3232
return { packages }
3333
}

packages/app-builder-lib/src/targets/pkg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class PkgTarget extends Target {
8080
args.push("--package-path", extraPackages.packagePath)
8181
}
8282
args.push(artifactPath)
83-
use(options.productbuild, it => args.push(...(it as any)))
83+
use(options.productbuild, it => args.push(...it))
8484
await exec("productbuild", args, {
8585
cwd: appOutDir,
8686
})

packages/dmg-builder/src/dmg.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ async function customizeDmg(volumePath: string, specification: DmgOptions, packa
262262

263263
const args = ["dmg", "--volume", volumePath]
264264
if (specification.icon != null) {
265-
args.push("--icon", (await packager.getResource(specification.icon))!)
265+
const icon = await packager.getResource(specification.icon)
266+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
267+
args.push("--icon", icon!)
266268
}
267269
if (backgroundFile != null) {
268270
args.push("--background", backgroundFile)

packages/dmg-builder/src/dmgUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function attachAndExecute(dmgPath: string, readWrite: boolean, task
3333
return await executeFinally(task(), () => detach(device))
3434
}
3535

36-
export async function detach(name: string) {
36+
export function detach(name: string) {
3737
return hdiUtil(["detach", "-quiet", name])
3838
}
3939

packages/dmg-builder/src/hdiuil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { exec, log, retry } from "builder-util"
22

3-
export async function hdiUtil(args: string[]) {
3+
export function hdiUtil(args: string[]) {
44
return retry(
55
() => exec("hdiutil", args),
66
5,

packages/electron-builder/src/cli/install-app-deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ function main() {
7474

7575
if (require.main === module) {
7676
log.warn("please use as subcommand: electron-builder install-app-deps")
77-
main().catch(printErrorAndExit)
77+
void main().catch(printErrorAndExit)
7878
}

packages/electron-builder/src/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ function main() {
117117

118118
if (require.main === module) {
119119
log.warn("please use as subcommand: electron-builder publish")
120-
main().catch(printErrorAndExit)
120+
void main().catch(printErrorAndExit)
121121
}

packages/electron-publish/src/keygenPublisher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class KeygenPublisher extends HttpPublisher {
148148
await httpExecutor.doApiRequest(configureRequestOptions(upload, null, "PUT"), this.context.cancellationToken, requestProcessor)
149149
}
150150

151-
private async createArtifact(releaseId: any, fileName: string, dataLength: number): Promise<{ data?: KeygenArtifact; errors?: KeygenError[] }> {
151+
private createArtifact(releaseId: any, fileName: string, dataLength: number): Promise<{ data?: KeygenArtifact; errors?: KeygenError[] }> {
152152
const upload: RequestOptions = {
153153
hostname: this.hostname,
154154
path: `${this.basePath}/artifacts`,
@@ -208,7 +208,7 @@ export class KeygenPublisher extends HttpPublisher {
208208
}
209209
}
210210

211-
private async getRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {
211+
private getRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {
212212
const req: RequestOptions = {
213213
hostname: this.hostname,
214214
path: `${this.basePath}/releases/${this.version}?product=${this.info.product}`,
@@ -222,7 +222,7 @@ export class KeygenPublisher extends HttpPublisher {
222222
return parseJson(httpExecutor.request(configureRequestOptions(req, this.auth, "GET"), this.context.cancellationToken, null))
223223
}
224224

225-
private async createRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {
225+
private createRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {
226226
const req: RequestOptions = {
227227
hostname: this.hostname,
228228
path: `${this.basePath}/releases`,

packages/electron-updater/src/differentialDownloader/downloadPlanBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function computeOperations(oldBlockMap: BlockMap, newBlockMap: BlockMap,
3737
const newFile = nameToNewBlocks.get(name)!
3838
let changedBlockCount = 0
3939

40-
const { checksumToOffset: checksumToOldOffset, checksumToOldSize } = buildChecksumMap(nameToOldBlocks.get(name)!, oldEntry.offset, logger)
40+
const { checksumToOffset: checksumToOldOffset, checksumToOldSize } = buildChecksumMap(nameToOldBlocks.get(name), oldEntry.offset, logger)
4141

4242
let newOffset = blockMapFile.offset
4343
for (let i = 0; i < newFile.checksums.length; newOffset += newFile.sizes[i], i++) {

0 commit comments

Comments
 (0)