Skip to content

Commit 2cb78bb

Browse files
authored
Merge branch 'master' into error-boundary-hook
2 parents 49b7826 + 83e08d3 commit 2cb78bb

File tree

1 file changed

+3
-3
lines changed
  • packages/babel-plugin-transform-jsx-to-htm

1 file changed

+3
-3
lines changed

packages/babel-plugin-transform-jsx-to-htm/index.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import jsx from '@babel/plugin-syntax-jsx';
44
* @param {Babel} babel
55
* @param {object} [options]
66
* @param {string} [options.tag='html'] The tagged template "tag" function name to produce.
7-
* @param {boolean} [options.terse=false] Output `<//>` for closing component tags
7+
* @param {boolean} [options.terse=false] Use `<//>` for closing component tags
88
* @param {string | boolean | object} [options.import=false] Import the tag automatically
99
*/
1010
export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
1111
const tagString = options.tag || 'html';
1212
const tag = dottedIdentifier(tagString);
1313
const importDeclaration = tagImport(options.import || false);
14+
const terse = options.terse === true;
1415

1516
function tagImport(imp) {
1617
if (imp === false) {
@@ -118,7 +119,6 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
118119
for (let i = 0; i < children.length; i++) {
119120
let child = children[i];
120121
if (t.isStringLiteral(child)) {
121-
// @todo - expose `whitespace: true` option?
122122
escapeText(child.value);
123123
}
124124
else if (t.isJSXElement(child)) {
@@ -131,7 +131,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
131131

132132
if (!isFragment) {
133133
if (isComponentName(name)) {
134-
if (options.terse) {
134+
if (terse) {
135135
raw('<//>');
136136
}
137137
else {

0 commit comments

Comments
 (0)