Skip to content

Commit e4768ac

Browse files
committed
fix: type parsed package.json to satisfy eslint
1 parent 5d04ffd commit e4768ac

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

typescript/packages/cli/src/main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ function resolveVersion(): string {
2727
let dir = dirname(fileURLToPath(import.meta.url))
2828
for (let i = 0; i < 6; i++) {
2929
try {
30-
const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'))
31-
if (pkg.name === '@struktoai/mirage-cli') return pkg.version
30+
const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')) as {
31+
name?: string
32+
version?: string
33+
}
34+
if (pkg.name === '@struktoai/mirage-cli' && pkg.version) return pkg.version
3235
} catch {
3336
// package.json absent at this level: keep walking up to the package root
3437
}

0 commit comments

Comments
 (0)