From 7f37b95b931857fa1c1848d67c0e70ff2dd76f81 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sun, 24 Jul 2022 13:16:15 +0200 Subject: [PATCH] Update `@types/estree-jsx` --- packages/mdx/lib/plugin/recma-document.js | 6 ++---- packages/mdx/lib/plugin/recma-jsx-rewrite.js | 1 - packages/mdx/package.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/mdx/lib/plugin/recma-document.js b/packages/mdx/lib/plugin/recma-document.js index 2b07a2866..82996bb90 100644 --- a/packages/mdx/lib/plugin/recma-document.js +++ b/packages/mdx/lib/plugin/recma-document.js @@ -224,10 +224,8 @@ export function recmaDocument(options = {}) { handleEsm(child) } else if ( child.type === 'ExpressionStatement' && - // @ts-expect-error types are wrong: `JSXElement`/`JSXFragment` are - // `Expression`s. + // @ts-expect-error types are wrong: `JSXFragment` is an `Expression`. (child.expression.type === 'JSXFragment' || - // @ts-expect-error " child.expression.type === 'JSXElement') ) { content = true @@ -523,7 +521,6 @@ export function recmaDocument(options = {}) { ] } - // @ts-expect-error: JSXElements are expressions. let result = /** @type {Expression} */ (element) if (!hasInternalLayout) { @@ -542,6 +539,7 @@ export function recmaDocument(options = {}) { let argument = content || {type: 'Literal', value: null} + // Unwrap a fragment of a single element. if ( argument && // @ts-expect-error: fine. diff --git a/packages/mdx/lib/plugin/recma-jsx-rewrite.js b/packages/mdx/lib/plugin/recma-jsx-rewrite.js index 4934eb7f8..d50b550a7 100644 --- a/packages/mdx/lib/plugin/recma-jsx-rewrite.js +++ b/packages/mdx/lib/plugin/recma-jsx-rewrite.js @@ -77,7 +77,6 @@ export function recmaJsxRewrite(options = {}) { enter(_node) { const node = /** @type {Node} */ (_node) const newScope = /** @type {Scope|undefined} */ ( - // @ts-expect-error: periscopic doesn’t support JSX. scopeInfo.map.get(node) ) diff --git a/packages/mdx/package.json b/packages/mdx/package.json index 06a66dcf0..2d92b1cf5 100644 --- a/packages/mdx/package.json +++ b/packages/mdx/package.json @@ -46,7 +46,7 @@ "index.js" ], "dependencies": { - "@types/estree-jsx": "^0.0.1", + "@types/estree-jsx": "^1.0.0", "@types/mdx": "^2.0.0", "astring": "^1.6.0", "estree-util-build-jsx": "^2.0.0",