Lint that a child feature's version range is inside its parent's range#30002
Draft
caugner wants to merge 2 commits into
Draft
Lint that a child feature's version range is inside its parent's range#30002caugner wants to merge 2 commits into
caugner wants to merge 2 commits into
Conversation
Correct sub-features that declared current or `preview` support while their parent's canonical-name support had been removed or was only available behind a flag: - `api.GeolocationCoordinates` [opera]: drop the stray `Coordinates` alternative name so the parent matches `opera_android` and its own members. - `javascript.builtins.Temporal` [safari]: drop the stale `useTemporal` flag; the namespace is exposed unflagged in preview alongside its members. - `api.WebTransport` parameter sub-features [deno]: add the `--unstable-net` flag carried by the interface and its methods. - `api.Navigator.activeVRDisplays.secure_context_required` [firefox]: track the parent's removal at 98 and flag-gated support thereafter. - `css.properties.resize` values [firefox_android]: replace `mirror` with the parent's "recognized, but has no effect" removal at 79.
Add a `subfeature_outside_parent_range` check to the `Consistency` linter that flags a sub-feature declaring current or `preview` support under the canonical feature name while the parent's canonical-name support exists but is no longer current (entirely `version_removed`, or only available behind a flag). This catches inconsistencies the scalar `version_added` checks miss, such as a child in `preview` under a parent whose only unprefixed support was removed. Prefixed and alternative-name statements are intentionally ignored, since BCD does not consistently propagate those to sub-features.
Contributor
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
subfeature_outside_parent_rangecheck to theConsistencylinter that flags a sub-feature declaring current orpreviewsupport under the canonical feature name while the parent's canonical-name support exists but is no longer current (entirelyversion_removed, or only available behind a flag). Prefixed and alternative-name statements are intentionally ignored, since BCD does not consistently propagate those to sub-features.This catches inconsistencies the scalar
version_addedchecks miss — such as a child inpreviewunder a parent whose only unprefixed support was removed (the case from #29904 that motivated the issue).Also fixes the 24 pre-existing data inconsistencies the new check surfaces:
api.GeolocationCoordinates[opera]: drop the strayCoordinatesalternative name so the parent matchesopera_androidand its own members.javascript.builtins.Temporal[safari]: drop the staleuseTemporalflag; the namespace is exposed unflagged in preview alongside its members.api.WebTransportparameter sub-features [deno]: add the--unstable-netflag carried by the interface and its methods.api.Navigator.activeVRDisplays.secure_context_required[firefox]: track the parent's removal at 98 and flag-gated support thereafter.css.properties.resizevalues [firefox_android]: replacemirrorwith the parent's "recognized, but has no effect" removal at 79.Test results and supporting details
lint/linter/test-consistency.test.js(positive cases incl. the issue's own example, plus negative guards for≤/true/mirror/prefixed/flagged children).npm testpasses;npm run lint -- --fail-on-warningspasses with zero findings across the dataset.Related issues
Fixes #29958.