Skip to content

Insonsistent parsing of JsxIdentifier #32701

Closed
@ajafff

Description

@ajafff

TypeScript Version: 3.6.0-dev.20190804

Search Terms:

Code

let a = <\u0061></a>; // works
let ab = <\u0061-b></a-b>; // works
let ac = <a-\u0063></a-c>; // reports mismatching closing tag

Expected behavior:

Consistent parsing of escaped characters in JSX Identifiers.
I don't know the JSX spec, so I cannot tell whether all should be valid or all should be invalid

Actual behavior:

parseJsxIdentifier is only responsible for everything after the first dash. It wasn't changed to support unicode characters. Therefore the regular Identifier parsing allows escaped characters in the first part.

Related Issues:

#32096 forgot to change parseJsxIdentifier. cc @weswigham

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions