Skip to content

Commit 41e964e

Browse files
committed
Update dev-dependencies
1 parent 1538244 commit 41e964e

File tree

5 files changed

+53
-53
lines changed

5 files changed

+53
-53
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
name: ${{matrix.node}}
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-node@v3
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
1212
with:
1313
node-version: ${{matrix.node}}
1414
- run: npm install
1515
- run: npm test
16-
- uses: codecov/codecov-action@v3
16+
- uses: codecov/codecov-action@v4
1717
strategy:
1818
matrix:
1919
node:
20-
- lts/gallium
20+
- lts/hydrogen
2121
- node

lib/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,20 @@ export function buildJsx(tree, options) {
333333

334334
spread = true
335335
} else {
336-
const prop = toProperty(attribute)
336+
const property = toProperty(attribute)
337337

338338
if (
339339
automatic &&
340-
prop.key.type === 'Identifier' &&
341-
prop.key.name === 'key'
340+
property.key.type === 'Identifier' &&
341+
property.key.name === 'key'
342342
) {
343343
if (spread) {
344344
throw new Error(
345345
'Expected `key` to come before any spread expressions'
346346
)
347347
}
348348

349-
const value = prop.value
349+
const value = property.value
350350

351351
assert(
352352
value.type !== 'AssignmentPattern' &&
@@ -357,7 +357,7 @@ export function buildJsx(tree, options) {
357357

358358
key = value
359359
} else {
360-
fields.push(prop)
360+
fields.push(property)
361361
}
362362
}
363363
}
@@ -523,7 +523,7 @@ function toProperty(node) {
523523
delete value.raw
524524
}
525525
}
526-
// Boolean prop.
526+
// Boolean property.
527527
else {
528528
value = {type: 'Literal', value: true}
529529
}
@@ -598,18 +598,18 @@ function toMemberExpression(id) {
598598

599599
while (++index < identifiers.length) {
600600
/** @type {Identifier | Literal} */
601-
const prop = isIdentifierName(identifiers[index])
601+
const property = isIdentifierName(identifiers[index])
602602
? {type: 'Identifier', name: identifiers[index]}
603603
: {type: 'Literal', value: identifiers[index]}
604604
result = result
605605
? {
606606
type: 'MemberExpression',
607607
object: result,
608-
property: prop,
609-
computed: Boolean(index && prop.type === 'Literal'),
608+
property,
609+
computed: Boolean(index && property.type === 'Literal'),
610610
optional: false
611611
}
612-
: prop
612+
: property
613613
}
614614

615615
assert(result, 'always a result')

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
"estree-walker": "^3.0.0"
4646
},
4747
"devDependencies": {
48-
"@types/node": "^20.0.0",
48+
"@types/node": "^22.0.0",
4949
"acorn": "^8.0.0",
5050
"acorn-jsx": "^5.0.0",
5151
"astring": "^1.0.0",
52-
"c8": "^8.0.0",
52+
"c8": "^10.0.0",
5353
"prettier": "^3.0.0",
54-
"remark-cli": "^11.0.0",
55-
"remark-preset-wooorm": "^9.0.0",
54+
"remark-cli": "^12.0.0",
55+
"remark-preset-wooorm": "^10.0.0",
5656
"type-coverage": "^2.0.0",
5757
"typescript": "^5.0.0",
58-
"xo": "^0.56.0"
58+
"xo": "^0.59.0"
5959
},
6060
"scripts": {
6161
"prepack": "npm run build && npm run format",

readme.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313
## Contents
1414

15-
* [What is this?](#what-is-this)
16-
* [When should I use this?](#when-should-i-use-this)
17-
* [Install](#install)
18-
* [Use](#use)
19-
* [API](#api)
20-
* [`buildJsx(tree[, options])`](#buildjsxtree-options)
21-
* [`Options`](#options)
22-
* [`Runtime`](#runtime-1)
23-
* [Examples](#examples)
24-
* [Example: use with Acorn](#example-use-with-acorn)
25-
* [Types](#types)
26-
* [Compatibility](#compatibility)
27-
* [Related](#related)
28-
* [Security](#security)
29-
* [Contribute](#contribute)
30-
* [License](#license)
15+
* [What is this?](#what-is-this)
16+
* [When should I use this?](#when-should-i-use-this)
17+
* [Install](#install)
18+
* [Use](#use)
19+
* [API](#api)
20+
* [`buildJsx(tree[, options])`](#buildjsxtree-options)
21+
* [`Options`](#options)
22+
* [`Runtime`](#runtime-1)
23+
* [Examples](#examples)
24+
* [Example: use with Acorn](#example-use-with-acorn)
25+
* [Types](#types)
26+
* [Compatibility](#compatibility)
27+
* [Related](#related)
28+
* [Security](#security)
29+
* [Contribute](#contribute)
30+
* [License](#license)
3131

3232
## What is this?
3333

@@ -137,18 +137,18 @@ they work on slightly different syntax trees.
137137

138138
Some differences:
139139

140-
* no pure annotations things
141-
* `this` is not a component: `<this>` -> `h('this')`, not `h(this)`
142-
* namespaces are supported: `<a:b c:d>` -> `h('a:b', {'c:d': true})`,
143-
which throws by default in Babel or can be turned on with `throwIfNamespace`
144-
* no `useSpread`, `useBuiltIns`, or `filter` options
140+
* no pure annotations things
141+
* `this` is not a component: `<this>` -> `h('this')`, not `h(this)`
142+
* namespaces are supported: `<a:b c:d>` -> `h('a:b', {'c:d': true})`,
143+
which throws by default in Babel or can be turned on with `throwIfNamespace`
144+
* no `useSpread`, `useBuiltIns`, or `filter` options
145145

146146
###### Parameters
147147

148-
* `tree` ([`Node`][node])
149-
— tree to transform (typically [`Program`][program])
150-
* `options` ([`Options`][api-options], optional)
151-
— configuration
148+
* `tree` ([`Node`][node])
149+
— tree to transform (typically [`Program`][program])
150+
* `options` ([`Options`][api-options], optional)
151+
— configuration
152152

153153
###### Returns
154154

@@ -264,11 +264,11 @@ compatible with Node.js 166.
264264
265265
## Related
266266
267-
* [`syntax-tree/hast-util-to-estree`](https://github.com/syntax-tree/hast-util-to-estree)
268-
— turn [hast](https://github.com/syntax-tree/hast) (HTML) to [estree][]
269-
JSX
270-
* [`coderaiser/estree-to-babel`](https://github.com/coderaiser/estree-to-babel)
271-
— turn [estree][] to Babel trees
267+
* [`syntax-tree/hast-util-to-estree`](https://github.com/syntax-tree/hast-util-to-estree)
268+
— turn [hast](https://github.com/syntax-tree/hast) (HTML) to [estree][]
269+
JSX
270+
* [`coderaiser/estree-to-babel`](https://github.com/coderaiser/estree-to-babel)
271+
— turn [estree][] to Babel trees
272272
273273
## Security
274274

test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ function expression(program) {
16771677
/**
16781678
* Parse a string of JS.
16791679
*
1680-
* @param {string} doc
1680+
* @param {string} document
16811681
* Value.
16821682
* @param {boolean} [clean=true]
16831683
* Clean positional info (default: `true`).
@@ -1686,12 +1686,11 @@ function expression(program) {
16861686
* @returns {Program}
16871687
* ESTree program.
16881688
*/
1689-
function parse(doc, clean, addComments) {
1689+
function parse(document, clean, addComments) {
16901690
/** @type {Array<Comment>} */
16911691
const comments = []
1692-
// @ts-expect-error: acorn is similar enough to estree.
16931692
const tree = /** @type {Program} */ (
1694-
parser.parse(doc, {
1693+
parser.parse(document, {
16951694
ecmaVersion: 'latest',
16961695
ranges: true,
16971696
locations: true,
@@ -1704,6 +1703,7 @@ function parse(doc, clean, addComments) {
17041703

17051704
if (clean !== false) walk(tree, {leave})
17061705

1706+
// eslint-disable-next-line unicorn/prefer-structured-clone -- JSON casting needed to remove class stuff.
17071707
return JSON.parse(JSON.stringify(tree))
17081708
}
17091709

0 commit comments

Comments
 (0)