Skip to content

Commit 6afd5b9

Browse files
committed
Update @types/estree
1 parent 097ca85 commit 6afd5b9

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

lib/index.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
* @typedef {import('hast').Element} Element
44
* @typedef {import('hast').Text} Text
55
* @typedef {import('hast').Comment} Comment
6-
* @typedef {import('hast').Properties} Properties
76
* @typedef {import('hast').Content} Content
87
* @typedef {Root|Content} Node
98
* @typedef {Extract<Node, import('unist').Parent>} Parent
10-
* @typedef {import('estree-jsx').Node} EstreeNode
11-
* @typedef {import('estree-jsx').Program} EstreeProgram
9+
* @typedef {import('estree').Node} EstreeNode
10+
* @typedef {import('estree').Program} EstreeProgram
11+
* @typedef {import('estree').Comment} EstreeComment
12+
* @typedef {import('estree').Directive} EstreeDirective
13+
* @typedef {import('estree').Statement} EstreeStatement
14+
* @typedef {import('estree').ModuleDeclaration} EstreeModuleDeclaration
15+
* @typedef {import('estree').Expression} EstreeExpression
16+
* @typedef {import('estree').Property} EstreeProperty
1217
* @typedef {import('estree-jsx').JSXExpressionContainer} EstreeJsxExpressionContainer
1318
* @typedef {import('estree-jsx').JSXElement} EstreeJsxElement
1419
* @typedef {import('estree-jsx').JSXOpeningElement} EstreeJsxOpeningElement
1520
* @typedef {import('estree-jsx').JSXFragment} EstreeJsxFragment
1621
* @typedef {import('estree-jsx').JSXAttribute} EstreeJsxAttribute
1722
* @typedef {import('estree-jsx').JSXSpreadAttribute} EstreeJsxSpreadAttribute
18-
* @typedef {import('estree-jsx').Comment} EstreeComment
19-
* @typedef {import('estree-jsx').Directive} EstreeDirective
20-
* @typedef {import('estree-jsx').Statement} EstreeStatement
21-
* @typedef {import('estree-jsx').ModuleDeclaration} EstreeModuleDeclaration
22-
* @typedef {import('estree-jsx').Expression} EstreeExpression
23-
* @typedef {import('estree-jsx').Property} EstreeProperty
2423
* @typedef {import('estree-jsx').JSXIdentifier} JSXIdentifier
2524
* @typedef {import('estree-jsx').JSXMemberExpression} JSXMemberExpression
2625
*
@@ -39,7 +38,6 @@
3938
*
4039
* @typedef {import('mdast-util-mdxjs-esm').MdxjsEsm} MdxjsEsm
4140
*
42-
* @typedef {ReturnType<find>} Info
4341
* @typedef {'html'|'svg'} Space
4442
*
4543
* @typedef {(node: any, context: Context) => EstreeJsxChild?} Handle
@@ -230,7 +228,7 @@ function element(node, context) {
230228

231229
if (prop === 'style') {
232230
/** @type {Record<string, string>} */
233-
// @ts-expect-error Assume `value` is then an object.
231+
// @ts-expect-error Assume `value` is an object otherwise.
234232
const styleValue =
235233
typeof value === 'string' ? parseStyle(value, node.tagName) : value
236234

@@ -319,8 +317,6 @@ function element(node, context) {
319317
* @returns {void}
320318
*/
321319
function mdxjsEsm(node, context) {
322-
/** @type {EstreeProgram} */
323-
// @ts-expect-error Assume program.
324320
const estree = node.data && node.data.estree
325321
const comments = (estree && estree.comments) || []
326322

@@ -337,8 +333,6 @@ function mdxjsEsm(node, context) {
337333
* @returns {EstreeJsxExpressionContainer}
338334
*/
339335
function mdxExpression(node, context) {
340-
/** @type {EstreeProgram} */
341-
// @ts-expect-error Assume program.
342336
const estree = node.data && node.data.estree
343337
const comments = (estree && estree.comments) || []
344338
/** @type {EstreeExpression|undefined} */
@@ -398,8 +392,6 @@ function mdxJsxElement(node, context) {
398392
}
399393
// `MdxJsxAttributeValueExpression`.
400394
else if (typeof value === 'object') {
401-
/** @type {EstreeProgram} */
402-
// @ts-expect-error Assume program.
403395
const estree = value.data && value.data.estree
404396
const comments = (estree && estree.comments) || []
405397
/** @type {EstreeExpression|undefined} */
@@ -437,8 +429,6 @@ function mdxJsxElement(node, context) {
437429
}
438430
// MdxJsxExpressionAttribute.
439431
else {
440-
/** @type {EstreeProgram} */
441-
// @ts-expect-error Assume program.
442432
const estree = attr.data && attr.data.estree
443433
const comments = (estree && estree.comments) || []
444434
/** @type {EstreeJsxSpreadAttribute['argument']|undefined} */

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"index.js"
4141
],
4242
"dependencies": {
43-
"@types/estree-jsx": "^0.0.1",
43+
"@types/estree": "^0.0.52",
44+
"@types/estree-jsx": "^0.0.2",
4445
"@types/hast": "^2.0.0",
4546
"@types/unist": "^2.0.0",
4647
"comma-separated-tokens": "^2.0.0",

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* @typedef {import('estree-jsx').Program} Program
3-
* @typedef {import('estree-jsx').Comment} Comment
4-
* @typedef {import('estree-jsx').Node} Node
2+
* @typedef {import('estree').Program} Program
3+
* @typedef {import('estree').Comment} Comment
4+
* @typedef {import('estree').Node} Node
55
* @typedef {import('hast').Root} Root
66
* @typedef {import('hast').Content} Content
77
* @typedef {Root|Content} HastNode

0 commit comments

Comments
 (0)