Skip to content

Commit

Permalink
fix(schema): make optional the options JSON schema field (#4080)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Sep 25, 2024
1 parent cc4c867 commit f3cfa8a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/@biomejs/biome/configuration_schema.json

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

10 changes: 10 additions & 0 deletions xtask/codegen/src/generate_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,18 @@ fn rename_partial_references_in_schema(mut schema: RootSchema) -> RootSchema {
key = "RuleFixConfiguration".to_string();
} else if let Some(stripped) = key.strip_prefix("RuleWithOptions_for_") {
key = format!("RuleWith{stripped}");
if let Schema::Object(schema_object) = &mut schema {
if let Some(object) = &mut schema_object.object {
object.required.remove("options");
}
}
} else if let Some(stripped) = key.strip_prefix("RuleWithFixOptions_for_") {
key = format!("RuleWith{stripped}");
if let Schema::Object(schema_object) = &mut schema {
if let Some(object) = &mut schema_object.object {
object.required.remove("options");
}
}
} else if let Some(stripped) = key
.strip_prefix("RuleConfiguration_for_")
.map(|x| x.strip_suffix("Options").unwrap_or(x))
Expand Down

0 comments on commit f3cfa8a

Please sign in to comment.