Skip to content

Commit 89cb9f7

Browse files
committed
Remove the html option from babel-plugin-transform-jsx-to-htm
1 parent 468d091 commit 89cb9f7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/babel-plugin-transform-jsx-to-htm/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ The following options are available:
3333
| Option | Type | Default | Description
3434
|--------|---------|----------|------------
3535
| `tag` | String | `"html"` | The "tag" function to prefix [Tagged Templates] with.<br> _Useful when [Auto-importing a tag function](#auto-importing-the-tag)._
36-
| `html` | Boolean | `false` | `true` outputs HTML-like templates for use with [lit-html].<br> _The is default XML-like, with self-closing tags._
3736

3837
Options are passed to a Babel plugin using a nested Array:
3938

4039
```js
4140
"plugins": [
4241
["babel-plugin-transform-jsx-to-htm", {
43-
"tag": "$$html",
44-
"html": true
42+
"tag": "$$html"
4543
}]
4644
]
4745
```

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import jsx from '@babel/plugin-syntax-jsx';
55
* @param {object} [options]
66
* @param {string} [options.tag='html'] The tagged template "tag" function name to produce.
77
* @param {string | boolean | object} [options.import=false] Import the tag automatically
8-
* @param {string} [options.html=false] If `true`, output HTML-like instead of XML-like (no self-closing tags, etc).
98
*/
109
export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
1110
const tagString = options.tag || 'html';
1211
const tag = dottedIdentifier(tagString);
13-
const htmlOutput = !!options.html;
1412
const importDeclaration = tagImport(options.import || false);
1513

1614
function tagImport(imp) {
@@ -130,7 +128,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
130128
}
131129

132130
const children = t.react.buildChildren(node);
133-
if (htmlOutput || children && children.length !== 0) {
131+
if (children && children.length !== 0) {
134132
raw('>');
135133
for (let i = 0; i < children.length; i++) {
136134
let child = children[i];

0 commit comments

Comments
 (0)