wxt-dev / wxt-dev/wxt

`unknown` should be used instead of `any` for `getItems`

Open
#1,025 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I noticed that in this snippet, value's type is any
https://github.com/wxt-dev/wxt/blob/d2702506332c03f40bfda9b3b59e4c4928e3099b/packages/wxt/src/storage.ts#L481-L485

I'm pretty sure the type should rather be unknown | null

Steps to reproduce

No response

System Info
System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
    Memory: 37.10 GB / 63.91 GB
  Binaries:
    Node: 20.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.11.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    wxt: ^0.19.10 => 0.19.10
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open packages/wxt/src/storage.ts at lines 481-485 and inspect the getItems type declaration. Check the surrounding storage API and run the repository's existing type checks or tests. Done means getItems no longer exposes any and its public value type matches the issue's requested unknown | null.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.