Skip to content

A double slash in a JSX input snippet causes the entire line to be parsed as jsx_text #607

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

Open
mkrause opened this issue Jan 27, 2025 · 0 comments

Comments

@mkrause
Copy link

mkrause commented Jan 27, 2025

Studio link: https://app.grit.io/studio?key=O3E0XN_U5icS3NAfyq-Jh

Given this input snippet:

const App = () => {
    return (
        <>
            <Test/>
            //<Test/>
        </>
    );
}

The //<Test/> line is parsed into the following AST:

Image

But a double slash in JSX shouldn't have any special interpretation, it should just be a text node and the <Test/> element should be parsed into a jsx_element.

@mkrause mkrause changed the title A double slash in a JSX input snippet seems to be parsed as a comment A double slash in a JSX input snippet causes the entire line to be parsed as jsx_text Jan 27, 2025
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

No branches or pull requests

1 participant