wxt
wxt copied to clipboard
`unknown` should be used instead of `any` for `getItems`
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
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
It would make it type safer but it also comes at a high compromise and that is that you are forced to check the types etc. and that would add complexity especially for beginners with TypeScript. Generally you'd be using the defineItem stuff either way
I can see both sides. Might be worth switching to unknown for v2, once storage is extracted.
I mean I personally am for it just thinking about others haha