Skip to content

Commit 6d77cef

Browse files
authored
fix(codegen): correct note for the "next" versioned rules (#2864)
1 parent d02f78a commit 6d77cef

File tree

69 files changed

+233
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+233
-234
lines changed

codegen/src/lintdoc.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
422422
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
423423
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
424424
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
425-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
425+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
426426
"#
427427
)?;
428428

@@ -512,7 +512,7 @@ fn generate_group(
512512
}
513513

514514
if meta.version == "next" {
515-
properties.push_str("<span class='inline-icon' title=\"This rule is only available in beta\"><Icon name=\"moon\" label=\"This rule is only available in beta\" size=\"1.2rem\" /></span>");
515+
properties.push_str("<span class='inline-icon' title=\"This rule is not released yet\"><Icon name=\"moon\" label=\"This rule is not released yet\" size=\"1.2rem\" /></span>");
516516
}
517517

518518
let summary_html = extract_summary_from_rule(meta.docs);
@@ -537,11 +537,7 @@ struct GenRule<'a> {
537537
}
538538

539539
/// Generates the documentation page for a single lint rule
540-
fn generate_rule(
541-
payload: GenRule,
542-
path_prefix: &str,
543-
rule_category: RuleCategory,
544-
) -> Result<()> {
540+
fn generate_rule(payload: GenRule, path_prefix: &str, rule_category: RuleCategory) -> Result<()> {
545541
let mut content = Vec::new();
546542

547543
let mut errors = Vec::new();
@@ -655,16 +651,28 @@ fn generate_rule_content(rule_content: RuleContent) -> Result<(Vec<u8>, String,
655651
)?;
656652
writeln!(content, ":::")?;
657653
}
658-
writeln!(content, "## Summary")?;
659654

660655
if meta.version == "next" {
661656
writeln!(content, ":::note")?;
662657
writeln!(
663658
content,
664-
"This rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta)."
659+
"This rule has been implemented but not released yet. It will be available in the next release."
665660
)?;
666661
writeln!(content, ":::")?;
667-
} else {
662+
}
663+
664+
if group == "nursery" {
665+
writeln!(content, ":::caution")?;
666+
writeln!(
667+
content,
668+
"This rule is part of the [nursery](/{path_prefix}/#nursery) group. This means that it is experimental and the behavior can change at any time."
669+
)?;
670+
writeln!(content, ":::")?;
671+
}
672+
673+
writeln!(content, "## Summary")?;
674+
675+
if meta.version != "next" {
668676
writeln!(content, "- Rule available since: `v{}`", meta.version)?;
669677
}
670678

@@ -769,15 +777,6 @@ fn generate_rule_content(rule_content: RuleContent) -> Result<(Vec<u8>, String,
769777
writeln!(content)?;
770778
}
771779

772-
if group == "nursery" {
773-
writeln!(content, ":::caution")?;
774-
writeln!(
775-
content,
776-
"This rule is part of the [nursery](/{path_prefix}/#nursery) group. This means that it is experimental and the behavior can change at any time."
777-
)?;
778-
writeln!(content, ":::")?;
779-
}
780-
781780
if rule_category == RuleCategory::Action {
782781
writeln!(content, "## How to enable in your editor")?;
783782
let action = if rule_name == "organizeImports" {

src/content/docs/assist/css/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717

1818
## `source`
1919

src/content/docs/assist/graphql/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717
## Recommended actions
1818

src/content/docs/assist/javascript/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717

1818
## `source`
1919

src/content/docs/assist/json/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717

1818
## `source`
1919

src/content/docs/linter/css/rules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717

1818
## `a11y`
1919

src/content/docs/linter/graphql/rules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Below the list of rules supported by Biome, divided by group. Here's a legend of
1313
- The icon <span class='inline-icon' title="This rule is recommended"><Icon name="approve-check-circle"x label="This rule is recommended" /></span> indicates that the rule is part of the recommended rules.
1414
- The icon <span class='inline-icon' title="This rule has a safe fix"><Icon name="seti:config" label="The rule has a safe fix" /></span> indicates that the rule provides a code action (fix) that is **safe** to apply.
1515
- The icon <span class='inline-icon' title="This rule has an unsafe fix"><Icon name="warning" label="The rule has an unsafe fix" /></span> indicates that the rule provides a code action (fix) that is **unsafe** to apply.
16-
- The icon <span class='inline-icon' title="This rule is only available in beta"><Icon name="moon" label="This rule is only available in beta" /></span> indicates that the rule is currently only available in the [2.0 beta release](/blog/biome-v2-0-beta).
16+
- The icon <span class='inline-icon' title="This rule is not released yet"><Icon name="moon" label="This rule is not released yet" /></span> indicates that the rule has been implemented and scheduled for the next release.
1717

1818
## `nursery`
1919

0 commit comments

Comments
 (0)