File tree 4 files changed +25
-2
lines changed
packages/prettier-plugin-liquid/src
4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @shopify/prettier-plugin-liquid ' : patch
3
+ ---
4
+
5
+ Prevent prettier from appending ` @description ` annotation before implicit descriptions
Original file line number Diff line number Diff line change @@ -581,10 +581,14 @@ export function printLiquidDocDescription(
581
581
_args : LiquidPrinterArgs ,
582
582
) : Doc {
583
583
const node = path . getValue ( ) ;
584
- const parts : Doc [ ] = [ '@description' ] ;
584
+ const parts : Doc [ ] = [ ] ;
585
+
586
+ if ( ! node . isImplicit ) {
587
+ parts . push ( '@description ' ) ;
588
+ }
585
589
586
590
if ( node . content ?. value ) {
587
- parts . push ( ' ' , node . content . value ) ;
591
+ parts . push ( node . content . value ) ;
588
592
}
589
593
590
594
return parts ;
Original file line number Diff line number Diff line change @@ -124,3 +124,10 @@ It should add padding between dissimilar nodes
124
124
125
125
@param {String} param3 - param with description
126
126
{% enddoc %}
127
+
128
+ It should not append an implicit description with an @description annotation
129
+ {% doc %}
130
+ This is an implicit description
131
+
132
+ @description This is an explicit description
133
+ {% enddoc %}
Original file line number Diff line number Diff line change @@ -118,3 +118,10 @@ It should add padding between dissimilar nodes
118
118
@description This is a description
119
119
@param {String} param3 - param with description
120
120
{% enddoc %}
121
+
122
+ It should not append an implicit description with an @description annotation
123
+ {% doc %}
124
+ This is an implicit description
125
+
126
+ @description This is an explicit description
127
+ {% enddoc %}
You can’t perform that action at this time.
0 commit comments