Skip to content

Commit

Permalink
Prettier support - dashSeperator
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Dec 11, 2024
1 parent 434b276 commit f68ce01
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/prettier-plugin-liquid/src/printer/print/liquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ export function printLiquidDocParam(
}

if (node.paramDescription.value) {
parts.push(' ', node.paramDescription.value);
if (node.paramDescription.dashSeparated) {
parts.push(' - ', node.paramDescription.value);
} else {
parts.push(' ', node.paramDescription.value);
}
}

return parts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ It should format the param type
{% doc %}
@param {string} paramName param with description
{% enddoc %}

It should format the param description with a dash separator
{% doc %}
@param paramName - param with description
{% enddoc %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ It should not dedent to root

It should trim whitespace between nodes
{% doc %}
@param paramName param with description
@param paramName param with description
{% enddoc %}

It should format the param type
{% doc %}
@param { string } paramName param with description
@param { string } paramName param with description
{% enddoc %}

It should format the param description with a dash separator
{% doc %}
@param paramName - param with description
{% enddoc %}

0 comments on commit f68ce01

Please sign in to comment.