Skip to content

TypeScript Lexer: JSX Nodes with a comment flagged as syntax errors #940

Closed
@jaller94

Description

@jaller94

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

JSX allows for Nodes to have in-line comments which start with // until the next new line.

import React from 'react';

export function Outro(): React.JSX.Element {
    return (
        <p
            // This is a comment
        >Thanks for reading!</p>
    );
}

To Reproduce

https://swapoff.org/chroma/playground/#eyJsYW5ndWFnZSI6IlR5cGVTY3JpcHQiLCJzdHlsZSI6Im1vbm9rYWlsaWdodCIsInRleHQiOiJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5leHBvcnQgZnVuY3Rpb24gT3V0cm8oKTogUmVhY3QuSlNYLkVsZW1lbnQge1xuICAgIHJldHVybiAoXG4gICAgICAgIDxwXG4gICAgICAgICAgICAvLyBUaGlzIGlzIGEgY29tbWVudFxuICAgICAgICA-VGhhbmtzIGZvciByZWFkaW5nITwvcD5cbiAgICApO1xufSIsImNsYXNzZXMiOmZhbHNlfQ

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions