mdn / mdn/browser-compat-data

Linter: check consistency of dependent features

Open
#6,571 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

idle linter
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

We currently have a 'subfeature_earlier_implementation' check, which would if for example the data claims that api.Document.title (document.title) was introduced before api.Document (document) itself.

This is an instance of one feature depending on another, but there are many more like this:

  • APIs that were introduced together, where shipping just one of them would make no sense, for example fetch() without a Response interface (however incomplete) would make no sense.
  • An interface that inherits from another, for example VTTCue inherits from TextTrackCue. api.VTTCue without api.TextTrackCue support is almost certainly an error.
  • An attribute of a certain type requires that type to exist. For example element.classList requires DOMTokenList.

More generalized, we have:

  • Implication: an entry/feature A that depends on another B, i.e., A ⇒ B and !B ⇒ !A (extremely common)
  • Equivalence: entries that must have matching support data, i.e., A ⇔ B (fairly rare)

A lot of this could be derived from Web IDL definitions. The lint for this could have a set of version dependencies, something like this:

[
  ["api.VTTCue", ">=", "api.TextTrackCue"],
  ["api.WindowOrWorkerGlobalScope.fetch", "==", "api.Response"]
]

This was inspired by https://github.com/mdn/browser-compat-data/pull/6564.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the existing subfeature_earlier_implementation check and the Web IDL-derived data it validates; done means defining and implementing a dependency representation that covers implication and equivalence cases, with validation for the examples described.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
data, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.