3
3
* @typedef {import('hast').Element } Element
4
4
* @typedef {import('hast').Text } Text
5
5
* @typedef {import('hast').Comment } Comment
6
- * @typedef {import('hast').Properties } Properties
7
6
* @typedef {import('hast').Content } Content
8
7
* @typedef {Root|Content } Node
9
8
* @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
12
17
* @typedef {import('estree-jsx').JSXExpressionContainer } EstreeJsxExpressionContainer
13
18
* @typedef {import('estree-jsx').JSXElement } EstreeJsxElement
14
19
* @typedef {import('estree-jsx').JSXOpeningElement } EstreeJsxOpeningElement
15
20
* @typedef {import('estree-jsx').JSXFragment } EstreeJsxFragment
16
21
* @typedef {import('estree-jsx').JSXAttribute } EstreeJsxAttribute
17
22
* @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
24
23
* @typedef {import('estree-jsx').JSXIdentifier } JSXIdentifier
25
24
* @typedef {import('estree-jsx').JSXMemberExpression } JSXMemberExpression
26
25
*
39
38
*
40
39
* @typedef {import('mdast-util-mdxjs-esm').MdxjsEsm } MdxjsEsm
41
40
*
42
- * @typedef {ReturnType<find> } Info
43
41
* @typedef {'html'|'svg' } Space
44
42
*
45
43
* @typedef {(node: any, context: Context) => EstreeJsxChild? } Handle
@@ -230,7 +228,7 @@ function element(node, context) {
230
228
231
229
if ( prop === 'style' ) {
232
230
/** @type {Record<string, string> } */
233
- // @ts -expect-error Assume `value` is then an object.
231
+ // @ts -expect-error Assume `value` is an object otherwise .
234
232
const styleValue =
235
233
typeof value === 'string' ? parseStyle ( value , node . tagName ) : value
236
234
@@ -319,8 +317,6 @@ function element(node, context) {
319
317
* @returns {void }
320
318
*/
321
319
function mdxjsEsm ( node , context ) {
322
- /** @type {EstreeProgram } */
323
- // @ts -expect-error Assume program.
324
320
const estree = node . data && node . data . estree
325
321
const comments = ( estree && estree . comments ) || [ ]
326
322
@@ -337,8 +333,6 @@ function mdxjsEsm(node, context) {
337
333
* @returns {EstreeJsxExpressionContainer }
338
334
*/
339
335
function mdxExpression ( node , context ) {
340
- /** @type {EstreeProgram } */
341
- // @ts -expect-error Assume program.
342
336
const estree = node . data && node . data . estree
343
337
const comments = ( estree && estree . comments ) || [ ]
344
338
/** @type {EstreeExpression|undefined } */
@@ -398,8 +392,6 @@ function mdxJsxElement(node, context) {
398
392
}
399
393
// `MdxJsxAttributeValueExpression`.
400
394
else if ( typeof value === 'object' ) {
401
- /** @type {EstreeProgram } */
402
- // @ts -expect-error Assume program.
403
395
const estree = value . data && value . data . estree
404
396
const comments = ( estree && estree . comments ) || [ ]
405
397
/** @type {EstreeExpression|undefined } */
@@ -437,8 +429,6 @@ function mdxJsxElement(node, context) {
437
429
}
438
430
// MdxJsxExpressionAttribute.
439
431
else {
440
- /** @type {EstreeProgram } */
441
- // @ts -expect-error Assume program.
442
432
const estree = attr . data && attr . data . estree
443
433
const comments = ( estree && estree . comments ) || [ ]
444
434
/** @type {EstreeJsxSpreadAttribute['argument']|undefined } */
0 commit comments