diff --git a/crates/biome_css_analyze/src/analyzers/nursery.rs b/crates/biome_css_analyze/src/analyzers/nursery.rs index 6702aee39715..d102cb954659 100644 --- a/crates/biome_css_analyze/src/analyzers/nursery.rs +++ b/crates/biome_css_analyze/src/analyzers/nursery.rs @@ -2,13 +2,13 @@ use biome_analyze::declare_group; -pub mod color_no_invalid_hex; +pub mod no_color_invalid_hex; declare_group! { pub Nursery { name : "nursery" , rules : [ - self :: color_no_invalid_hex :: ColorNoInvalidHex , + self :: no_color_invalid_hex :: NoColorInvalidHex , ] } } diff --git a/crates/biome_css_analyze/src/analyzers/nursery/color_no_invalid_hex.rs b/crates/biome_css_analyze/src/analyzers/nursery/no_color_invalid_hex.rs similarity index 95% rename from crates/biome_css_analyze/src/analyzers/nursery/color_no_invalid_hex.rs rename to crates/biome_css_analyze/src/analyzers/nursery/no_color_invalid_hex.rs index f9cfc762542b..5a0f2790180b 100644 --- a/crates/biome_css_analyze/src/analyzers/nursery/color_no_invalid_hex.rs +++ b/crates/biome_css_analyze/src/analyzers/nursery/no_color_invalid_hex.rs @@ -29,14 +29,14 @@ declare_rule! { /// } /// ``` /// - pub ColorNoInvalidHex { + pub NoColorInvalidHex { version: "next", - name: "colorNoInvalidHex", + name: "noColorInvalidHex", recommended: false, } } -impl Rule for ColorNoInvalidHex { +impl Rule for NoColorInvalidHex { type Query = Ast; type State = CssDeclarationOrRuleBlock; type Signals = Option; diff --git a/crates/biome_css_analyze/src/options.rs b/crates/biome_css_analyze/src/options.rs index 19fe68e33df2..a6d6312e2b71 100644 --- a/crates/biome_css_analyze/src/options.rs +++ b/crates/biome_css_analyze/src/options.rs @@ -2,5 +2,5 @@ use crate::analyzers; -pub type ColorNoInvalidHex = - ::Options; +pub type NoColorInvalidHex = + ::Options; diff --git a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/invalid.css.snap b/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/invalid.css.snap deleted file mode 100644 index 9b435a4512ab..000000000000 --- a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/invalid.css.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: crates/biome_css_analyze/tests/spec_tests.rs -expression: invalid.css ---- -# Input -```css -p { - color: red; - text-align: center; -} -``` diff --git a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/valid.css.snap b/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/valid.css.snap deleted file mode 100644 index 5cfefa8379f3..000000000000 --- a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/valid.css.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: crates/biome_css_analyze/tests/spec_tests.rs -expression: valid.css ---- -# Input -```css -/* should not generate diagnostics */ -p { - color: red; - text-align: center; -} -``` diff --git a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/invalid.css b/crates/biome_css_analyze/tests/specs/nursery/noColorInvalidHex/invalid.css similarity index 100% rename from crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/invalid.css rename to crates/biome_css_analyze/tests/specs/nursery/noColorInvalidHex/invalid.css diff --git a/crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/valid.css b/crates/biome_css_analyze/tests/specs/nursery/noColorInvalidHex/valid.css similarity index 100% rename from crates/biome_css_analyze/tests/specs/nursery/colorNoInvalidHex/valid.css rename to crates/biome_css_analyze/tests/specs/nursery/noColorInvalidHex/valid.css diff --git a/crates/biome_diagnostics_categories/src/categories.rs b/crates/biome_diagnostics_categories/src/categories.rs index 786ab070cb65..1e40cc559cb0 100644 --- a/crates/biome_diagnostics_categories/src/categories.rs +++ b/crates/biome_diagnostics_categories/src/categories.rs @@ -109,6 +109,7 @@ define_categories! { "lint/nursery/colorNoInvalidHex": "https://biomejs.dev/linter/rules/color-no-invalid-hex", "lint/nursery/noApproximativeNumericConstant": "https://biomejs.dev/linter/rules/no-approximative-numeric-constant", "lint/nursery/noBarrelFile": "https://biomejs.dev/linter/rules/no-barrel-file", + "lint/nursery/noColorInvalidHex": "https://biomejs.dev/linter/rules/no-color-invalid-hex", "lint/nursery/noConsole": "https://biomejs.dev/linter/rules/no-console", "lint/nursery/noDoneCallback": "https://biomejs.dev/linter/rules/no-done-callback", "lint/nursery/noDuplicateElseIf": "https://biomejs.dev/linter/rules/no-duplicate-else-if", diff --git a/crates/biome_service/src/configuration/linter/rules.rs b/crates/biome_service/src/configuration/linter/rules.rs index be9f727a1a16..8559f1246fc4 100644 --- a/crates/biome_service/src/configuration/linter/rules.rs +++ b/crates/biome_service/src/configuration/linter/rules.rs @@ -2613,12 +2613,12 @@ pub struct Nursery { #[doc = r" It enables ALL rules for this group."] #[serde(skip_serializing_if = "Option::is_none")] pub all: Option, - #[doc = "Succinct description of the rule."] - #[serde(skip_serializing_if = "Option::is_none")] - pub color_no_invalid_hex: Option>, #[doc = "Disallow the use of barrel file."] #[serde(skip_serializing_if = "Option::is_none")] pub no_barrel_file: Option>, + #[doc = "Succinct description of the rule."] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_color_invalid_hex: Option>, #[doc = "Disallow the use of console."] #[serde(skip_serializing_if = "Option::is_none")] pub no_console: Option>, @@ -2697,8 +2697,8 @@ impl DeserializableValidator for Nursery { impl Nursery { const GROUP_NAME: &'static str = "nursery"; pub(crate) const GROUP_RULES: [&'static str; 22] = [ - "colorNoInvalidHex", "noBarrelFile", + "noColorInvalidHex", "noConsole", "noDoneCallback", "noDuplicateElseIf", @@ -2781,12 +2781,12 @@ impl Nursery { } pub(crate) fn get_enabled_rules(&self) -> IndexSet { let mut index_set = IndexSet::new(); - if let Some(rule) = self.color_no_invalid_hex.as_ref() { + if let Some(rule) = self.no_barrel_file.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); } } - if let Some(rule) = self.no_barrel_file.as_ref() { + if let Some(rule) = self.no_color_invalid_hex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); } @@ -2895,12 +2895,12 @@ impl Nursery { } pub(crate) fn get_disabled_rules(&self) -> IndexSet { let mut index_set = IndexSet::new(); - if let Some(rule) = self.color_no_invalid_hex.as_ref() { + if let Some(rule) = self.no_barrel_file.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); } } - if let Some(rule) = self.no_barrel_file.as_ref() { + if let Some(rule) = self.no_color_invalid_hex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); } @@ -3048,14 +3048,14 @@ impl Nursery { rule_name: &str, ) -> Option<(RulePlainConfiguration, Option)> { match rule_name { - "colorNoInvalidHex" => self - .color_no_invalid_hex - .as_ref() - .map(|conf| (conf.level(), conf.get_options())), "noBarrelFile" => self .no_barrel_file .as_ref() .map(|conf| (conf.level(), conf.get_options())), + "noColorInvalidHex" => self + .no_color_invalid_hex + .as_ref() + .map(|conf| (conf.level(), conf.get_options())), "noConsole" => self .no_console .as_ref() diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts index aead39782530..b0f09bb35901 100644 --- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts +++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts @@ -888,14 +888,14 @@ export interface Nursery { * It enables ALL rules for this group. */ all?: boolean; - /** - * Succinct description of the rule. - */ - colorNoInvalidHex?: RuleConfiguration_for_Null; /** * Disallow the use of barrel file. */ noBarrelFile?: RuleConfiguration_for_Null; + /** + * Succinct description of the rule. + */ + noColorInvalidHex?: RuleConfiguration_for_Null; /** * Disallow the use of console. */ @@ -1894,6 +1894,7 @@ export type Category = | "lint/nursery/colorNoInvalidHex" | "lint/nursery/noApproximativeNumericConstant" | "lint/nursery/noBarrelFile" + | "lint/nursery/noColorInvalidHex" | "lint/nursery/noConsole" | "lint/nursery/noDoneCallback" | "lint/nursery/noDuplicateElseIf" diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json index 86b6efa2a398..2505599f508b 100644 --- a/packages/@biomejs/biome/configuration_schema.json +++ b/packages/@biomejs/biome/configuration_schema.json @@ -1381,15 +1381,15 @@ "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, - "colorNoInvalidHex": { - "description": "Succinct description of the rule.", + "noBarrelFile": { + "description": "Disallow the use of barrel file.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, - "noBarrelFile": { - "description": "Disallow the use of barrel file.", + "noColorInvalidHex": { + "description": "Succinct description of the rule.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" }