Skip to content

Commit

Permalink
feat: rename rule
Browse files Browse the repository at this point in the history
  • Loading branch information
togami2864 committed Apr 25, 2024
1 parent 07408b6 commit 7eee138
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 47 deletions.
49 changes: 28 additions & 21 deletions crates/biome_configuration/src/linter/rules.rs

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

4 changes: 2 additions & 2 deletions crates/biome_css_analyze/src/lint/nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub mod no_css_empty_block;
pub mod no_duplicate_font_names;
pub mod no_duplicate_selectors_keyframe_block;
pub mod no_important_in_keyframe;
pub mod no_missing_generic_family_keyword;
pub mod no_unknown_unit;
pub mod use_generic_font_names;

declare_group! {
pub Nursery {
Expand All @@ -19,8 +19,8 @@ declare_group! {
self :: no_duplicate_font_names :: NoDuplicateFontNames ,
self :: no_duplicate_selectors_keyframe_block :: NoDuplicateSelectorsKeyframeBlock ,
self :: no_important_in_keyframe :: NoImportantInKeyframe ,
self :: no_missing_generic_family_keyword :: NoMissingGenericFamilyKeyword ,
self :: no_unknown_unit :: NoUnknownUnit ,
self :: use_generic_font_names :: UseGenericFontNames ,
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use biome_analyze::{context::RuleContext, declare_rule, Ast, Rule, RuleDiagnostic};
use biome_analyze::{context::RuleContext, declare_rule, Ast, Rule, RuleDiagnostic, RuleSource};
use biome_console::markup;
use biome_css_syntax::{
AnyCssAtRule, AnyCssGenericComponentValue, AnyCssValue, CssAtRule,
Expand Down Expand Up @@ -57,14 +57,15 @@ declare_rule! {
/// @font-face { font-family: Gentium; }
/// ```
///
pub NoMissingGenericFamilyKeyword {
pub UseGenericFontNames {
version: "next",
name: "noMissingGenericFamilyKeyword",
recommended: false,
name: "useGenericFontNames",
recommended: true,
sources: &[RuleSource::Stylelint("font-family-no-missing-generic-family-keyword")],
}
}

impl Rule for NoMissingGenericFamilyKeyword {
impl Rule for UseGenericFontNames {
type Query = Ast<CssGenericProperty>;
type State = TextRange;
type Signals = Option<Self::State>;
Expand Down
3 changes: 2 additions & 1 deletion crates/biome_css_analyze/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub type NoDuplicateFontNames =
<lint::nursery::no_duplicate_font_names::NoDuplicateFontNames as biome_analyze::Rule>::Options;
pub type NoDuplicateSelectorsKeyframeBlock = < lint :: nursery :: no_duplicate_selectors_keyframe_block :: NoDuplicateSelectorsKeyframeBlock as biome_analyze :: Rule > :: Options ;
pub type NoImportantInKeyframe = < lint :: nursery :: no_important_in_keyframe :: NoImportantInKeyframe as biome_analyze :: Rule > :: Options ;
pub type NoMissingGenericFamilyKeyword = < lint :: nursery :: no_missing_generic_family_keyword :: NoMissingGenericFamilyKeyword as biome_analyze :: Rule > :: Options ;
pub type NoUnknownUnit =
<lint::nursery::no_unknown_unit::NoUnknownUnit as biome_analyze::Rule>::Options;
pub type UseGenericFontNames =
<lint::nursery::use_generic_font_names::UseGenericFontNames as biome_analyze::Rule>::Options;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ a { font: 1em Lucida Grande, Arial, "sans-serif" }

# Diagnostics
```
invalid.css:1:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:1:18 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -37,7 +37,7 @@ invalid.css:1:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:2:44 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:2:44 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -60,7 +60,7 @@ invalid.css:2:44 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:3:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:3:18 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -84,7 +84,7 @@ invalid.css:3:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:4:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:4:18 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -108,7 +108,7 @@ invalid.css:4:18 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:5:39 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:5:39 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -132,7 +132,7 @@ invalid.css:5:39 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:6:43 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:6:43 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand All @@ -155,7 +155,7 @@ invalid.css:6:43 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━
```

```
invalid.css:7:37 lint/nursery/noMissingGenericFamilyKeyword ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.css:7:37 lint/nursery/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Generic font family missing.
Expand Down
1 change: 1 addition & 0 deletions crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ define_categories! {
"lint/nursery/noUnknownUnit": "https://biomejs.dev/linter/rules/no-unknown-unit",
"lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment",
"lint/nursery/useConsistentNewBuiltin": "https://biomejs.dev/linter/rules/use-consistent-new-builtin",
"lint/nursery/useGenericFontNames": "https://biomejs.dev/linter/rules/use-generic-font-names",
"lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions",
"lint/nursery/useSortedClasses": "https://biomejs.dev/linter/rules/use-sorted-classes",
"lint/performance/noAccumulatingSpread": "https://biomejs.dev/linter/rules/no-accumulating-spread",
Expand Down
9 changes: 5 additions & 4 deletions packages/@biomejs/backend-jsonrpc/src/workspace.ts

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

14 changes: 7 additions & 7 deletions packages/@biomejs/biome/configuration_schema.json

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

0 comments on commit 7eee138

Please sign in to comment.