webhintio / hint

💡 A hinting engine for the web
https://webhint.io/
Apache License 2.0
3.63k stars 685 forks source link

[Feature] Use MDN data to show compatibility for JavaScript APIs #3767

Open antross opened 4 years ago

antross commented 4 years ago

I thought we'd discussed this before, but I don't see an associated issue so filing one for tracking.

It would be a nice addition to the existing HTML and CSS support provided by hint-compat-api. Would likely need to be paired with an understanding of types (so either TypeScript-only or using the TypeScript parser against JavaScript) to minimize false-positives.

For example, I've seen users confused about varying support for using array-extras like forEach on various non-Array DOM collections (e.g. NodeList). This could help.

antross commented 4 years ago

One uncertainty is the impact on bundle size for the browser extension and utils-worker which don't currently include parser-typescript. Performance will also be impacted to a degree as deriving types is almost certainly going to be slower than just parsing JS normally.