use-baseline
What it does
Section titled “What it does”Reports an element, an attribute or an attribute value that not all major browsers support (<geolocation>, popover="hint", rel="manifest" on <link>), by the baseline data of web-features. A name the data does not list is not reported; custom elements are skipped, and so are is and slot in Vue, Svelte and Angular templates, where the framework owns them. The option available sets how widely a feature must be available.
Why it matters
Section titled “Why it matters”A feature that only some browsers have works for part of the users and does nothing or breaks for the rest, and the author sees it only in the browser they test with.
To fix, use a feature with wider support, or provide a fallback and turn the rule off for it.
Example
Section titled “Example”<a href="x" download>x</a><button interestfor="x">x</button><link rel="manifest" href="m"><link rel="stylesheet" href="s"><geolocation></geolocation><p foo="bar" popover="hint">x</p><my-element interestfor="x"></my-element><datalist id="l"></datalist><p autocorrect="on">x</p>Configuration
Section titled “Configuration”angular: lint: rules: use-baseline: level: warn # off (default), warn, error options: available: "widely"html: lint: rules: use-baseline: level: warn # off (default), warn, error options: available: "widely"svelte: lint: rules: use-baseline: level: warn # off (default), warn, error options: available: "widely"vue: lint: rules: use-baseline: level: warn # off (default), warn, error options: available: "widely"| Option | Type | Default | Description |
|---|---|---|---|
available |
string | "widely" |
How widely a feature must be available: widely (in all major browsers for 30 months), newly (in all of them), or a year (baseline since that year or before). |
Enabled by the presets: html/html-eslint-recommended.
Suppress one line with sudsy-disable-next-line use-baseline in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-eslint | use-baseline |
partial | not the sms: links (a value prefix) |