mdn / browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
4.91k stars 1.97k forks source link

Consistency linter: needs to compare version_removed version, not just truthiness #12982

Open foolip opened 2 years ago

foolip commented 2 years ago

The lint already disallows declaring a sub-feature supported when the parent feature is set to false, or declaring a sub-feature shipped earlier than a parent feature. However, it doesn't catch cases with ranges. This is the case where I noticed it:

Parent feature: https://github.com/mdn/browser-compat-data/blob/ea482a5bb65cc914e5a8c4cefdfffc792d77a745/api/Touch.json#L17-L26

Sub-feature: https://github.com/mdn/browser-compat-data/blob/ea482a5bb65cc914e5a8c4cefdfffc792d77a745/api/Touch.json#L73-L75

This should fail the lint, because in Firefox 46 the parent feature wasn't enabled.

foolip commented 2 months ago

Another case of this is shared workers:

https://github.com/mdn/browser-compat-data/blob/ebb58c142ff3f1dcade8857de96d16fb8e2f80f1/api/SharedWorker.json#L155-L161

That should fail the lint because Safari 15 isn't supported by the parent feature:

https://github.com/mdn/browser-compat-data/blob/ebb58c142ff3f1dcade8857de96d16fb8e2f80f1/api/SharedWorker.json#L93-L101

I stumbled on this in https://github.com/web-platform-dx/web-features/pull/1294.