mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(ast): correct TS types for JSX (#5884)
Part of #5354. #5882 and #5883 corrected the JSON AST for JSX types to make it ESTree-compatible. Bring the TS types into line with those changes.
This commit is contained in:
parent
0d105212bc
commit
66e919e59b
2 changed files with 7 additions and 2 deletions
|
|
@ -168,7 +168,6 @@ pub struct JSXClosingFragment {
|
||||||
#[ast(visit)]
|
#[ast(visit)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)]
|
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)]
|
||||||
#[cfg_attr(feature = "serialize", derive(Tsify))]
|
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum JSXElementName<'a> {
|
pub enum JSXElementName<'a> {
|
||||||
/// `<div />`
|
/// `<div />`
|
||||||
|
|
@ -238,7 +237,6 @@ pub struct JSXMemberExpression<'a> {
|
||||||
#[ast(visit)]
|
#[ast(visit)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)]
|
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash)]
|
||||||
#[cfg_attr(feature = "serialize", derive(Tsify))]
|
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum JSXMemberExpressionObject<'a> {
|
pub enum JSXMemberExpressionObject<'a> {
|
||||||
IdentifierReference(Box<'a, IdentifierReference<'a>>) = 0,
|
IdentifierReference(Box<'a, IdentifierReference<'a>>) = 0,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,13 @@ use oxc_span::{Atom, Span};
|
||||||
|
|
||||||
use crate::ast::*;
|
use crate::ast::*;
|
||||||
|
|
||||||
|
#[cfg(feature = "serialize")]
|
||||||
|
#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)]
|
||||||
|
const TS_APPEND_CONTENT: &'static str = r#"
|
||||||
|
export type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
|
||||||
|
export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
|
||||||
|
"#;
|
||||||
|
|
||||||
// 1.2 JSX Elements
|
// 1.2 JSX Elements
|
||||||
|
|
||||||
impl<'a> JSXIdentifier<'a> {
|
impl<'a> JSXIdentifier<'a> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue