Skip to content

Commit ccb66c6

Browse files
committed
Update dev-dependencies
1 parent 003f7f7 commit ccb66c6

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"tape": "^5.0.0",
6262
"type-coverage": "^2.0.0",
6363
"typescript": "^4.0.0",
64-
"xo": "^0.38.0"
64+
"xo": "^0.39.0"
6565
},
6666
"scripts": {
6767
"prepack": "npm run build && npm run format",

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ And our script, `example.js`, looks as follows:
5858
import fs from 'fs'
5959
import {Parser} from 'acorn'
6060
import jsx from 'acorn-jsx'
61-
import astring from 'astring'
61+
import {generate} from 'astring'
6262
import {buildJsx} from 'estree-util-build-jsx'
6363

6464
var doc = fs.readFileSync('example.jsx')
@@ -70,7 +70,7 @@ var tree = Parser.extend(jsx()).parse(doc, {
7070

7171
buildJsx(tree, {pragma: 'x', pragmaFrag: 'null'})
7272

73-
console.log(astring.generate(tree))
73+
console.log(generate(tree))
7474
```
7575

7676
Now, running `node example` yields:

test.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Parser} from 'acorn'
33
// @ts-ignore
44
import jsx from 'acorn-jsx'
55
import {walk} from 'estree-walker'
6-
import astring from 'astring'
6+
import {generate} from 'astring'
77
import recast from 'recast'
88
import escodegen from 'escodegen'
99
import {buildJsx} from './index.js'
@@ -87,7 +87,7 @@ test('estree-util-build-jsx', function (t) {
8787
)
8888

8989
t.equal(
90-
astring.generate(buildJsx(parse('<x />'), {pragma: 'a.b-c'})),
90+
generate(buildJsx(parse('<x />'), {pragma: 'a.b-c'})),
9191
'a["b-c"]("x");\n',
9292
'should support `pragma` w/ non-identifiers (2)'
9393
)
@@ -247,7 +247,7 @@ test('estree-util-build-jsx', function (t) {
247247
)
248248

249249
t.equal(
250-
astring.generate(buildJsx(parse('<a.b-c />'), {pragma: 'h'})),
250+
generate(buildJsx(parse('<a.b-c />'), {pragma: 'h'})),
251251
'h(a["b-c"]);\n',
252252
'should support dots *and* dashes in tag names (2)'
253253
)
@@ -272,7 +272,7 @@ test('estree-util-build-jsx', function (t) {
272272
)
273273

274274
t.equal(
275-
astring.generate(buildJsx(parse('<a-b.c />'), {pragma: 'h'})),
275+
generate(buildJsx(parse('<a-b.c />'), {pragma: 'h'})),
276276
'h(("a-b").c);\n',
277277
'should support dots *and* dashes in tag names (4)'
278278
)
@@ -849,7 +849,7 @@ test('estree-util-build-jsx', function (t) {
849849
)
850850

851851
t.equal(
852-
astring.generate(
852+
generate(
853853
buildJsx(parse('<>\n <a b c="d" e={f} {...g}>h</a>\n</>'), {
854854
pragma: 'h',
855855
pragmaFrag: 'f'
@@ -1143,7 +1143,7 @@ test('estree-util-build-jsx', function (t) {
11431143
)
11441144

11451145
t.deepEqual(
1146-
astring.generate(buildJsx(parse('<>a</>'), {runtime: 'automatic'})),
1146+
generate(buildJsx(parse('<>a</>'), {runtime: 'automatic'})),
11471147
[
11481148
'import {Fragment as _Fragment, jsx as _jsx} from "react/jsx-runtime";',
11491149
'_jsx(_Fragment, {',
@@ -1155,9 +1155,7 @@ test('estree-util-build-jsx', function (t) {
11551155
)
11561156

11571157
t.deepEqual(
1158-
astring.generate(
1159-
buildJsx(parse('/*@jsxRuntime automatic*/\n<a key="a">b{1}</a>'))
1160-
),
1158+
generate(buildJsx(parse('/*@jsxRuntime automatic*/\n<a key="a">b{1}</a>'))),
11611159
[
11621160
'import {jsxs as _jsxs} from "react/jsx-runtime";',
11631161
'_jsxs("a", {',
@@ -1169,9 +1167,7 @@ test('estree-util-build-jsx', function (t) {
11691167
)
11701168

11711169
t.deepEqual(
1172-
astring.generate(
1173-
buildJsx(parse('<a b="1" {...c}>d</a>'), {runtime: 'automatic'})
1174-
),
1170+
generate(buildJsx(parse('<a b="1" {...c}>d</a>'), {runtime: 'automatic'})),
11751171
[
11761172
'import {jsx as _jsx} from "react/jsx-runtime";',
11771173
'_jsx("a", Object.assign({',
@@ -1185,7 +1181,7 @@ test('estree-util-build-jsx', function (t) {
11851181
)
11861182

11871183
t.deepEqual(
1188-
astring.generate(
1184+
generate(
11891185
buildJsx(parse('<a {...{b: 1, c: 2}} d="e">f</a>'), {
11901186
runtime: 'automatic'
11911187
})
@@ -1205,7 +1201,7 @@ test('estree-util-build-jsx', function (t) {
12051201
)
12061202

12071203
t.deepEqual(
1208-
astring.generate(buildJsx(parse('<a>b</a>'), {runtime: 'automatic'})),
1204+
generate(buildJsx(parse('<a>b</a>'), {runtime: 'automatic'})),
12091205
[
12101206
'import {jsx as _jsx} from "react/jsx-runtime";',
12111207
'_jsx("a", {',
@@ -1217,7 +1213,7 @@ test('estree-util-build-jsx', function (t) {
12171213
)
12181214

12191215
t.deepEqual(
1220-
astring.generate(buildJsx(parse('<a/>'), {runtime: 'automatic'})),
1216+
generate(buildJsx(parse('<a/>'), {runtime: 'automatic'})),
12211217
[
12221218
'import {jsx as _jsx} from "react/jsx-runtime";',
12231219
'_jsx("a", {});',
@@ -1227,7 +1223,7 @@ test('estree-util-build-jsx', function (t) {
12271223
)
12281224

12291225
t.deepEqual(
1230-
astring.generate(buildJsx(parse('<a key/>'), {runtime: 'automatic'})),
1226+
generate(buildJsx(parse('<a key/>'), {runtime: 'automatic'})),
12311227
[
12321228
'import {jsx as _jsx} from "react/jsx-runtime";',
12331229
'_jsx("a", {}, true);',
@@ -1245,7 +1241,7 @@ test('estree-util-build-jsx', function (t) {
12451241
)
12461242

12471243
t.deepEqual(
1248-
astring.generate(
1244+
generate(
12491245
buildJsx(parse('/*@jsxRuntime classic*/ <a/>'), {runtime: 'automatic'})
12501246
),
12511247
'React.createElement("a");\n',

0 commit comments

Comments
 (0)