diff --git a/crates/biome_js_analyze/src/lint/correctness/no_undeclared_dependencies.rs b/crates/biome_js_analyze/src/lint/correctness/no_undeclared_dependencies.rs index 664771872446..6c91829cf5e3 100644 --- a/crates/biome_js_analyze/src/lint/correctness/no_undeclared_dependencies.rs +++ b/crates/biome_js_analyze/src/lint/correctness/no_undeclared_dependencies.rs @@ -82,7 +82,7 @@ declare_lint_rule! { } } -#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)] +#[derive(Clone, Debug, Default, serde::Deserialize)] enum DependencyAvailability { /// Dependencies are always available. #[default] @@ -133,6 +133,19 @@ impl Deserializable for DependencyAvailability { } } +impl serde::Serialize for DependencyAvailability { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + Self::Available => true.serialize(serializer), + Self::Unavailable => false.serialize(serializer), + Self::FilesGlob(globs) => globs.serialize(serializer), + } + } +} + #[cfg(feature = "schemars")] impl schemars::JsonSchema for DependencyAvailability { fn schema_name() -> String { diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index ee64b93fee9c..fa471bff6f55 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -2107,17 +2107,17 @@ "properties": { "devDependencies": { "description": "If set to `false`, then the rule will show an error when `devDependencies` are imported. Defaults to `true`.", - "default": "Available", + "default": true, "allOf": [{ "$ref": "#/definitions/DependencyAvailability" }] }, "optionalDependencies": { "description": "If set to `false`, then the rule will show an error when `optionalDependencies` are imported. Defaults to `true`.", - "default": "Available", + "default": true, "allOf": [{ "$ref": "#/definitions/DependencyAvailability" }] }, "peerDependencies": { "description": "If set to `false`, then the rule will show an error when `peerDependencies` are imported. Defaults to `true`.", - "default": "Available", + "default": true, "allOf": [{ "$ref": "#/definitions/DependencyAvailability" }] } },