Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
foolip opened this issue Oct 21, 2021 · 1 comment
Labels
linter Issues or pull requests regarding the tests / linter of the JSON files.

Comments

@foolip
Copy link
Contributor

foolip commented Oct 21, 2021

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:

"firefox": [
{
"version_added": "52"
},
{
"version_added": "18",
"version_removed": "24",
"notes": "Removed in <a href='https://bugzil.la/888304'>bug 888304</a> due to web compatibility issues."
}
],

Sub-feature:

"firefox": {
"version_added": "46"
},

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

@foolip
Copy link
Contributor Author

foolip commented Jul 4, 2024

Another case of this is shared workers:

"safari": {
"version_added": "15",
"notes": [
"Nested workers support was introduced in Safari 15.5.",
"Script loading in nested workers was introduced in Safari 16.4."
]
},

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

"safari": [
{
"version_added": "16"
},
{
"version_added": "5",
"version_removed": "7"
}
],

I stumbled on this in web-platform-dx/web-features#1294.

@queengooborg queengooborg changed the title Lint for sub-features being supported when the parent feature(s) are not Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter Issues or pull requests regarding the tests / linter of the JSON files.
1 participant