-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: disallows unicode escape sequence in jsx
- Loading branch information
1 parent
06db35c
commit eba9910
Showing
7 changed files
with
197 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
tests/baselines/reference/unicodeEscapesInJsxtags.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
tests/cases/conformance/jsx/file.tsx(15,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(16,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(17,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(18,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(19,6): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(20,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(21,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(22,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(23,4): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(26,9): error TS17021: Unicode escape sequence cannot appear here. | ||
tests/cases/conformance/jsx/file.tsx(27,9): error TS17021: Unicode escape sequence cannot appear here. | ||
|
||
|
||
==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== | ||
import * as React from "react"; | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
"a-b": any; | ||
"a-c": any; | ||
} | ||
} | ||
} | ||
const Compa = (x: {x: number}) => <div>{"" + x}</div>; | ||
const x = { video: () => null } | ||
|
||
// unicode escape sequence is not allowed in tag name or JSX attribute name. | ||
// tag name: | ||
; <\u0061></a> | ||
~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <\u0061-b></a-b> | ||
~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <a-\u0063></a-c> | ||
~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <Comp\u0061 x={12} /> | ||
~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <x.\u0076ideo /> | ||
~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <\u{0061}></a> | ||
~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <\u{0061}-b></a-b> | ||
~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <a-\u{0063}></a-c> | ||
~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
; <Comp\u{0061} x={12} /> | ||
~~~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
|
||
// attribute name | ||
;<video data-\u0076ideo /> | ||
~~~~~~~~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
;<video \u0073rc="" /> | ||
~~~~~~~~ | ||
!!! error TS17021: Unicode escape sequence cannot appear here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.