File tree Expand file tree Collapse file tree
snapshots/main_commands_check Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @biomejs/biome " : patch
3+ ---
4+
5+ Fixed [ #6668 ] ( https://github.com/biomejs/biome/issues/6668 ) , where Biome didn't enable the assist for CSS files by default.
Original file line number Diff line number Diff line change @@ -3175,3 +3175,50 @@ fn doesnt_check_file_when_assist_is_disabled() {
31753175 result,
31763176 ) ) ;
31773177}
3178+
3179+ #[ test]
3180+ fn check_returns_error_for_css_sorting ( ) {
3181+ let fs = MemoryFileSystem :: default ( ) ;
3182+ let mut console = BufferConsole :: default ( ) ;
3183+
3184+ fs. insert (
3185+ "biome.json" . into ( ) ,
3186+ r#"{
3187+ "assist": {
3188+ "enabled": true,
3189+ "actions": {
3190+ "source": {
3191+ "useSortedProperties": "on"
3192+ }
3193+ }
3194+ }
3195+ }"# ,
3196+ ) ;
3197+
3198+ let file_path = Utf8Path :: new ( "src/file.css" ) ;
3199+ fs. insert (
3200+ file_path. into ( ) ,
3201+ r#"body {
3202+ padding: 1em;
3203+ color: red;
3204+ display: block;
3205+ }
3206+ "#
3207+ . as_bytes ( ) ,
3208+ ) ;
3209+
3210+ let ( fs, result) = run_cli (
3211+ fs,
3212+ & mut console,
3213+ Args :: from ( [ "check" , file_path. as_str ( ) ] . as_slice ( ) ) ,
3214+ ) ;
3215+
3216+ assert ! ( result. is_err( ) , "run_cli returned {result:?}" ) ;
3217+ assert_cli_snapshot ( SnapshotPayload :: new (
3218+ module_path ! ( ) ,
3219+ "check_returns_error_for_css_sorting" ,
3220+ fs,
3221+ console,
3222+ result,
3223+ ) ) ;
3224+ }
Original file line number Diff line number Diff line change 1+ -- -
2+ source : crates / biome_cli / tests / snap_test .rs
3+ expression : redactor (content )
4+ -- -
5+ ## ` biome.json`
6+
7+ ` ` ` json
8+ {
9+ " assist" : {
10+ " enabled" : true ,
11+ " actions" : {
12+ " source" : {
13+ " useSortedProperties" : " on"
14+ }
15+ }
16+ }
17+ }
18+ ` ` `
19+
20+ ## ` src/file.css`
21+
22+ ` ` ` css
23+ body {
24+ padding : 1em ;
25+ color : red ;
26+ display : block ;
27+ }
28+
29+ ` ` `
30+
31+ # Termination Message
32+
33+ ` ` ` block
34+ check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
35+
36+ × Some errors were emitted while running checks.
37+
38+
39+
40+ ` ` `
41+
42+ # Emitted Messages
43+
44+ ` ` ` block
45+ src/file.css:1:6 assist/source/useSortedProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46+
47+ × The properties are not sorted.
48+
49+ > 1 │ body {
50+ │ ^
51+ > 2 │ padding : 1em ;
52+ > 3 │ color : red ;
53+ > 4 │ display : block ;
54+ > 5 │ }
55+ │ ^
56+ 6 │
57+
58+ i Safe fix: Sort these properties
59+
60+ 1 1 │ body {
61+ 2 │ - ··padding :·1em ;
62+ 3 │ - ··color :·red ;
63+ 4 │ - ··display :·block ;
64+ 2 │ + ··display :·block ;
65+ 3 │ + ··padding :·1em ;
66+ 4 │ + ··color :·red ;
67+ 5 5 │ }
68+ 6 6 │
69+
70+
71+ ` ` `
72+
73+ ` ` ` block
74+ src/file.css format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75+
76+ × Formatter would have printed the following content:
77+
78+ 1 1 │ body {
79+ 2 │ - ··padding :·1em ;
80+ 3 │ - ··color :·red ;
81+ 4 │ - ··display :·block ;
82+ 2 │ + → padding :·1em ;
83+ 3 │ + → color :·red ;
84+ 4 │ + → display :·block ;
85+ 5 5 │ }
86+ 6 6 │
87+
88+
89+ ` ` `
90+
91+ ` ` ` block
92+ Checked 1 file in <TIME >. No fixes applied.
93+ Found 2 errors.
94+ ```
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ impl CssLinterConfiguration {
123123 }
124124}
125125
126- pub type CssAssistEnabled = Bool < false > ;
126+ pub type CssAssistEnabled = Bool < true > ;
127127
128128/// Options that changes how the CSS assist behaves
129129#[ derive(
You can’t perform that action at this time.
0 commit comments