Skip to content

Commit b77c61f

Browse files
committed
lint lib/config
1 parent 470c39b commit b77c61f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/config/dockerSecret.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function getSecret(secret) {
99
return undefined
1010
}
1111

12-
let dockerSecretConfig: any = {}
12+
// eslint-disable-next-line
13+
let dockerSecretConfig: Record<string, any> = {}
14+
1315
if (fs.existsSync(basePath)) {
1416
dockerSecretConfig = {
1517
dbURL: getSecret('dburl'),

lib/config/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import * as fs from "fs";
22
import * as path from "path";
33

4-
export function toBooleanConfig(configValue) {
4+
export function toBooleanConfig(configValue: string | boolean): boolean {
55
if (configValue && typeof configValue === 'string') {
66
return (configValue === 'true')
77
}
8-
return configValue
8+
return configValue as boolean
99
}
1010

11-
export function toArrayConfig(configValue, separator = ',', fallback ?: any) {
11+
export function toArrayConfig(configValue: string | [], separator = ',', fallback ?: string[]): string[] {
1212
if (configValue && typeof configValue === 'string') {
1313
return (configValue.split(separator).map(arrayItem => arrayItem.trim()))
1414
}
1515
return fallback
1616
}
1717

18-
export function toIntegerConfig(configValue) {
18+
export function toIntegerConfig(configValue: string | number): number {
1919
if (configValue && typeof configValue === 'string') {
2020
return parseInt(configValue)
2121
}
22-
return configValue
22+
return configValue as number
2323
}
2424

25-
export function getGitCommit(repodir) {
25+
export function getGitCommit(repodir: string): string {
2626
if (!fs.existsSync(repodir + '/.git/HEAD')) {
2727
return undefined
2828
}
@@ -35,7 +35,7 @@ export function getGitCommit(repodir) {
3535
return reference
3636
}
3737

38-
export function getGitHubURL(repo, reference) {
38+
export function getGitHubURL(repo: string, reference: string): string {
3939
// if it's not a github reference, we handle handle that anyway
4040
if (!repo.startsWith('https://github.com') && !repo.startsWith('git@github.com')) {
4141
return repo

0 commit comments

Comments
 (0)