This key defines which value types do not require root value boundaries when parsing snippet parameters.
The value is an object where each property key is a value type name and each property value is a boolean. When set to true, that value type does not require root value boundaries. For example, MDX specifies { string: true }, which allows strings to exist as <Component arg="true" /> rather than <Component arg={"true"} />.
Appears in#
└── Snippet Format
└── root_value_boundary_optionalType#
Object<root_value_boundary_optional.*>
Values#
This key represents an individual optional root value boundary configuration in the root_value_boundary_optional object.
The value is a boolean that determines whether the root value boundary is optional for a specific parameter name. When set to true, the boundary tokens are optional for that parameter.
Appears in: Snippet Format root_value_boundary_optional.
Show examplesHide examples
In this example, we have configured root value boundaries to be optional for the title parameter.
_snippets:
example:
snippet: <<example [[param]]>>
params:
param:
parser: argument
options:
format:
root_value_boundary_optional:
title: true{
"_snippets": {
"example": {
"snippet": "<<example [[param]]>>",
"params": {
"param": {
"parser": "argument",
"options": {
"format": {
"root_value_boundary_optional": {
"title": true
}
}
}
}
}
}
}
}Examples#
In this example, we have configured root value boundaries to be optional for strings.
_snippets:
example:
snippet: <<example [[param]]>>
params:
param:
parser: argument
options:
format:
root_value_boundary_optional:
string: true{
"_snippets": {
"example": {
"snippet": "<<example [[param]]>>",
"params": {
"param": {
"parser": "argument",
"options": {
"format": {
"root_value_boundary_optional": {
"string": true
}
}
}
}
}
}
}
}