ampproject / ampproject/amphtml
Type checker does not warn when no type inference can be made
Open
Stale
Type: Bug
WG: infra
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/ampproject/amphtml/issues/26483
In `amp-auto-lightbox`, the `this.element` does not have a type declaration. The use of `this.element` is therefore not checked against available methods by type checker. Any method in the entire codebase having the same method name would satisfy the type checker.
In case of a refactoring where the method is moved from a class to another, the type checker will pass.
We could look at whether we should generate warning or block the PR when insufficient information is provided (especially in extensions) for the type checker to properly do its jobs.
Contributor guide
Assessment
This issue has not been assessed yet.