From be4cf77f45ef3cf3e67988505638127aa3987ba3 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 17 Nov 2025 08:39:37 +0000 Subject: [PATCH 1/2] chore: schema regression rule domains --- .../src/analyzer/linter/mod.rs | 8 ++++-- .../@biomejs/backend-jsonrpc/src/workspace.ts | 28 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/crates/biome_configuration/src/analyzer/linter/mod.rs b/crates/biome_configuration/src/analyzer/linter/mod.rs index aa31b95b8697..e267825479c1 100644 --- a/crates/biome_configuration/src/analyzer/linter/mod.rs +++ b/crates/biome_configuration/src/analyzer/linter/mod.rs @@ -68,14 +68,16 @@ impl schemars::JsonSchema for RuleDomains { std::borrow::Cow::Borrowed("RuleDomains") } - fn json_schema(_generator: &mut schemars::SchemaGenerator) -> schemars::Schema { + fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema { + let _names = generator.subschema_for::(); + let _values = generator.subschema_for::(); schemars::json_schema!({ "type": "object", "propertyNames": { - "$ref": "#/definitions/RuleDomain" + "$ref": "#/components/schemas/RuleDomain" }, "additionalProperties": { - "$ref": "#/definitions/RuleDomainValue" + "$ref": "#/components/schemas/RuleDomainValue" } }) } diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts index bfcf68fbf8c2..b20e6788de35 100644 --- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts +++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts @@ -824,7 +824,7 @@ export interface JsonParserConfiguration { */ allowTrailingCommas?: Bool; } -export type RuleDomains = { [K in any]?: any }; +export type RuleDomains = { [K in RuleDomain]?: RuleDomainValue }; export interface Rules { a11y?: SeverityOrA11y; complexity?: SeverityOrComplexity; @@ -970,6 +970,19 @@ export type JsTrailingCommas = "all" | "es5" | "none"; * Print trailing commas wherever possible in multi-line comma-separated syntactic structures for JSON files. */ export type JsonTrailingCommas = "none" | "all"; +/** + * Rule domains + */ +export type RuleDomain = + | "react" + | "test" + | "solid" + | "next" + | "qwik" + | "vue" + | "project" + | "tailwind"; +export type RuleDomainValue = "all" | "none" | "recommended"; export type SeverityOrA11y = GroupPlainConfiguration | A11y; export type SeverityOrComplexity = GroupPlainConfiguration | Complexity; export type SeverityOrCorrectness = GroupPlainConfiguration | Correctness; @@ -7948,19 +7961,6 @@ export interface SearchResults { export interface DropPatternParams { pattern: PatternId; } -/** - * Rule domains - */ -export type RuleDomain = - | "react" - | "test" - | "solid" - | "next" - | "qwik" - | "vue" - | "project" - | "tailwind"; -export type RuleDomainValue = "all" | "none" | "recommended"; export interface Workspace { fileFeatures(params: SupportsFeatureParams): Promise; updateSettings(params: UpdateSettingsParams): Promise; From da0ccab276c586dbe9428e6fcc81ee8442703182 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 08:46:20 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .../@biomejs/biome/configuration_schema.json | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index 0b497b597e6e..107866595449 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -5798,10 +5798,72 @@ }, "required": ["level", "options"] }, + "RuleDomain": { + "description": "Rule domains", + "oneOf": [ + { + "description": "React library rules", + "type": "string", + "const": "react" + }, + { "description": "Testing rules", "type": "string", "const": "test" }, + { + "description": "Solid.js framework rules", + "type": "string", + "const": "solid" + }, + { + "description": "Next.js framework rules", + "type": "string", + "const": "next" + }, + { + "description": "Qwik framework rules", + "type": "string", + "const": "qwik" + }, + { + "description": "Vue.js framework rules", + "type": "string", + "const": "vue" + }, + { + "description": "For rules that require querying multiple files inside a project", + "type": "string", + "const": "project" + }, + { + "description": "Tailwind CSS rules", + "type": "string", + "const": "tailwind" + } + ] + }, + "RuleDomainValue": { + "oneOf": [ + { + "description": "Enables all the rules that belong to this domain", + "type": "string", + "const": "all" + }, + { + "description": "Disables all the rules that belong to this domain", + "type": "string", + "const": "none" + }, + { + "description": "Enables only the recommended rules for this domain", + "type": "string", + "const": "recommended" + } + ] + }, "RuleDomains": { "type": "object", - "additionalProperties": { "$ref": "#/definitions/RuleDomainValue" }, - "propertyNames": { "$ref": "#/definitions/RuleDomain" } + "additionalProperties": { + "$ref": "#/components/schemas/RuleDomainValue" + }, + "propertyNames": { "$ref": "#/components/schemas/RuleDomain" } }, "RulePlainConfiguration": { "oneOf": [