fix(cli): remove explicit any type to pass ESLint checks

Replace 'any' type annotation with proper type guard in inventory-store.ts
and add optional chaining in test to satisfy TypeScript strict checks.

All three platforms (Ubuntu, macOS, Windows) CI checks now pass.
This commit is contained in:
dongmucat 2026-04-29 15:43:32 +08:00
parent 05177e3085
commit a2df5f4eb4
2 changed files with 3 additions and 3 deletions

View file

@ -74,8 +74,8 @@ export class InventoryStore {
const lockData = JSON.stringify({ pid: process.pid, timestamp: Date.now() })
await writeFile(lockPath, lockData)
return lockHandle
} catch (err: any) {
if (err.code !== 'EEXIST') throw err
} catch (err) {
if (err instanceof Error && 'code' in err && err.code !== 'EEXIST') throw err
// Lock exists, check if it's stale (older than 30 seconds)
// 30s threshold chosen to balance between:

View file

@ -62,7 +62,7 @@ describe('InventoryStore', () => {
const inventory = await store.read()
expect(inventory.items).toHaveLength(1)
expect(inventory.items[0].slug).toBe('test-skill')
expect(inventory.items[0]?.slug).toBe('test-skill')
})
test('removeTarget returns false when item not found', async () => {