ValidDocParamTypes
ValidDocParamTypes
Severity: error | Type: LiquidHtml
This check ensures that type annotations in {% doc %} tag @param entries are valid platformOS types. Invalid type names prevent tooling (autocomplete, type checking) from working correctly and indicate a mistake in the documentation.
Valid types are read from the platformOS docset, which publishes them in liquid_doc.json — so this check accepts exactly the types the platform documents, and the doc tag reference lists them with their descriptions. They are:
- the primitive types
string,numberandboolean; dateandtime, the typesto_dateandto_timereturn;- the generic types
object(anything that is not a primitive) andarray(a list of values of any type); - the name of an object from the platformOS objects reference, for example
page,current_userorparams— except the objects the platform supplies to a file directly and that are therefore never passed as arguments:context(in scope everywhere),content_for_layout(layouts only), anddataandresponse(api_calls only); - any of the above with a
[]suffix, to describe an array of that type —string[],number[],object[].
A docset published before liquid_doc.json existed carries no type list, and then this check reports nothing rather than reporting every annotation as invalid.
Type names are lowercase. Integer, Float, Hash and String are not platformOS types.
Examples
✗ Incorrect Code Example (Avoid using this):
{% doc %}
@param {Integer} count - A count value
@param {txt} label - A label string
{% enddoc %}
Integer and txt are not valid platformOS types.
✓ Correct Code Example (Use this instead):
{% doc %}
@param {number} count - A count value
@param {string} label - A label string
@param {number[]} ids - A list of numeric ids
@param {array} rows - A list of mixed values
{% enddoc %}
Configuration
The default configuration for this check:
ValidDocParamTypes:
enabled: true
severity: error
Disabling This Check
Disabling this check is not recommended. Run pos-cli check update-docs to refresh the platformOS docset if you are getting false positives after a platform update.