Skip to content

Commit 4512cf0

Browse files
committed
chore(fix): typescript errors
1 parent 22d01b0 commit 4512cf0

File tree

9 files changed

+13
-14
lines changed

9 files changed

+13
-14
lines changed

src/commands/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ async function cloneMissingRepos(cfg: RootConfig, skipOptional?: boolean) {
273273
`Cloned ${green(cwdRelative(dest))} from`,
274274
repo.url.replace(/^.+:\/\//, '')
275275
)
276-
} catch (err) {
276+
} catch (err: any) {
277277
task.finish()
278278
if (/\bnot (read|found)\b/.test(err.message)) {
279279
return warn(

src/commands/link.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default (cfg: RootConfig | null) => {
3333
if (name) {
3434
if (!cfg) {
3535
fatal('Missing config. Did you run', cyan('indo init'), 'yet?')
36-
return
3736
}
3837
if (!args.g) {
3938
return linkGlobalPackage(cfg, {

src/core/buildPackages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function buildPackage(pkg: Package) {
5757
const task = startTask(`Building ${cyan(cwdRelative(pkg.root))}`)
5858
try {
5959
await promise
60-
} catch (e) {
60+
} catch (e: any) {
6161
task.finish()
6262
log.error('Build script failed:', yellow(cwdRelative(pkg.root)))
6363
if (isTest) {

src/core/cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface JSONCache<T = any> {
1010
find(fn: (value: T, key: string) => boolean): T
1111
}
1212

13-
interface ManagedJSONCache extends JSONCache {
13+
interface ManagedJSONCache<T = any> extends JSONCache<T> {
1414
save(): void
1515
}
1616

@@ -21,14 +21,14 @@ export function loadCache<T>(
2121
cachePath: string,
2222
onLoad?: (cache: JSONCache<T>) => void
2323
): JSONCache<T> {
24-
let cache: JSONCache<T> = caches[cachePath]
24+
let cache: ManagedJSONCache<T> = caches[cachePath]
2525
if (cache) {
2626
return cache
2727
}
2828
let data: any
2929
try {
3030
data = fs.readJson(cachePath)
31-
} catch (err) {
31+
} catch (err: any) {
3232
if (err.code == fs.NOT_REAL) {
3333
data = {}
3434
} else {

src/core/config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function loadConfig(configPath = findConfig(), force?: boolean) {
5454
let rawConfig: any
5555
try {
5656
rawConfig = fs.readJson(configPath)
57-
} catch (err) {
57+
} catch (err: any) {
5858
if (err.code == fs.NOT_REAL) return null
5959
throw err
6060
}
@@ -96,9 +96,10 @@ export function createConfig(props?: Partial<Config>): Config {
9696
}
9797
}
9898

99-
export function saveConfig(cfg: RootConfig) {
100-
const copy = {}
101-
const empty = createConfig()
99+
export function saveConfig(cfg: RootConfig): void
100+
export function saveConfig(cfg: any) {
101+
const copy: any = {}
102+
const empty: any = createConfig()
102103
for (const key in cfg) {
103104
if (key in empty && !isDeepEqual(cfg[key], empty[key])) {
104105
copy[key] = cfg[key]

src/core/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function parseGitString(
9090
let commit: string | undefined
9191
let subpath: string | undefined
9292

93-
if (gitString?.length > 0) {
93+
if (gitString) {
9494
if (gitString.includes(':')) {
9595
;[gitString, subpath] = gitString.split(':')
9696
}

src/core/installPackages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function installPackages(packages: Package[], force?: boolean) {
3636
task.finish()
3737
log.debug('install completed:', yellow(cwdRelative(pkg.root)))
3838
log.events.emit('install', pkg)
39-
} catch (e) {
39+
} catch (e: any) {
4040
task.finish()
4141
log.error('Installation failed:', yellow(cwdRelative(pkg.root)))
4242
if (isTest) {

src/core/sparseClone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function sparseClone(
99
url: string,
1010
branch: string | undefined,
1111
commit: string | undefined,
12-
subpath: string | undefined
12+
subpath: string
1313
) {
1414
fs.mkdir(dest)
1515
let checkoutCommand = `git clone ${url} . --no-checkout --depth 1`

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"outDir": "dist",
1212
"sourceMap": true,
1313
"strict": true,
14-
"suppressImplicitAnyIndexErrors": true,
1514
"target": "es2018"
1615
}
1716
}

0 commit comments

Comments
 (0)