Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #remove on JsxElement and JsxSelfClosingElement #1371

Open
wants to merge 4 commits into
base: latest
Choose a base branch
from

Conversation

dherault
Copy link

Add support for JsxElement.remove and JsxSelfClosingElement.remove

If anything just ask I'm around.

});

it("should remove the JsxElement child", () => {
doTestWithJsxElementChild(`var t = (<jsx><jsx2></jsx2></jsx>);`, `var t = (<jsx></jsx>);`);
Copy link
Owner

@dsherret dsherret Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but it's not so simple unfortunately. Once spaces are added then it gets much more complicated because spaces have meaning in JSX. It's why I haven't had the time to add this functionality yet. For example:

it("should remove the JsxElement child when has spaces", () => {
      doTestWithJsxElementChild(
        `var t = (<jsx>
        <jsx2></jsx2>
      </jsx>);`,
        `var t = (<jsx></jsx>);`,
      );
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants