mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
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:
parent
05177e3085
commit
a2df5f4eb4
2 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue