Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/add-use-baseline-css-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@biomejs/biome": patch
---

Added new nursery lint rule `useBaseline` for CSS. The rule reports when CSS properties, property values, at-rules, media conditions, functions, or pseudo-selectors are not part of the configured [Baseline](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility) tier.

For example, *at the time of writing*, the rule will trigger for the use of `accent-color` because it has limited availability:

```css
a { accent-color: bar; }
```
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crates/biome_analyze/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ pub enum RuleSource<'a> {
EslintMarkdown(&'a str),
/// Rules from [Eslint Plugin Yml](https://ota-meshi.github.io/eslint-plugin-yml/)
EslintYml(&'a str),
/// Rules from [Eslint CSS](https://github.com/eslint/css)
EslintCss(&'a str),
}

impl<'a> std::fmt::Display for RuleSource<'a> {
Expand Down Expand Up @@ -239,6 +241,7 @@ impl<'a> std::fmt::Display for RuleSource<'a> {
Self::EslintJson(_) => write!(f, "@eslint/json"),
Self::EslintMarkdown(_) => write!(f, "@eslint/markdown"),
Self::EslintYml(_) => write!(f, "eslint-plugin-yml"),
Self::EslintCss(_) => write!(f, "@eslint/css"),
}
}
}
Expand Down Expand Up @@ -303,6 +306,7 @@ impl<'a> RuleSource<'a> {
Self::EslintJson(_) => 41,
Self::EslintMarkdown(_) => 42,
Self::EslintYml(_) => 43,
Self::EslintCss(_) => 44,
}
}

Expand Down Expand Up @@ -362,6 +366,7 @@ impl<'a> RuleSource<'a> {
| Self::Stylelint(rule_name)
| Self::EslintTurbo(rule_name)
| Self::HtmlEslint(rule_name)
| Self::EslintCss(rule_name)
| Self::EslintPlaywright(rule_name)
| Self::EslintJson(rule_name)
| Self::EslintMarkdown(rule_name)
Expand Down Expand Up @@ -415,6 +420,7 @@ impl<'a> RuleSource<'a> {
Self::EslintJson(_) => "json",
Self::EslintMarkdown(_) => "markdown",
Self::EslintYml(_) => "yml",
Self::EslintCss(_) => "css",
}
}

Expand Down Expand Up @@ -472,6 +478,7 @@ impl<'a> RuleSource<'a> {
Self::EslintJson(rule_name) => format!("https://github.com/eslint/json/blob/main/docs/rules/{rule_name}.md"),
Self::EslintMarkdown(rule_name) => format!("https://github.com/eslint/markdown/blob/main/docs/rules/{rule_name}.md"),
Self::EslintYml(rule_name) => format!("https://ota-meshi.github.io/eslint-plugin-yml/rules/{rule_name}.html"),
Self::EslintCss(rule_name) => format!("https://github.com/eslint/css/blob/main/docs/rules/{rule_name}.md"),
}
}

Expand Down
16 changes: 16 additions & 0 deletions crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/biome_configuration/src/analyzer/linter/rules.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/biome_css_analyze/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ biome_rule_options = { workspace = true }
biome_string_case = { workspace = true }
biome_suppression = { workspace = true }
camino = { workspace = true }
phf = { workspace = true }
regex = { workspace = true }
rustc-hash = { workspace = true }
schemars = { workspace = true, optional = true }
Expand Down
Loading
Loading