ampproject / ampproject/worker-dom
FR: Type checking for DOM methods
Open
API
- Dominant language
- TypeScript
- Stars
- 3.3k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Calling something like `el.appendChild('hello')` is invalid and normally throws
```Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.```
In WorkerDOM, however, the error is a lot more ambiguous:
```Uncaught TypeError: t.remove is not a function```
While this is a developer error, it took me a while to figure out what's wrong. I think stronger type checking would help with the developer experience here.
Contributor guide
Assessment
This issue has not been assessed yet.