-
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.
Add error for using jsx factory pragma with fragments
- Loading branch information
Showing
7 changed files
with
119 additions
and
2 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
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.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,18 @@ | ||
tests/cases/conformance/jsx/inline/index.tsx(3,1): error TS17017: JSX fragment is not supported when using an inline JSX factory pragma | ||
|
||
|
||
==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ==== | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
export function dom(): void; | ||
==== tests/cases/conformance/jsx/inline/index.tsx (1 errors) ==== | ||
/** @jsx dom */ | ||
import { dom } from "./renderer"; | ||
<><h></h></> | ||
~~~~~~~~~~~~ | ||
!!! error TS17017: JSX fragment is not supported when using an inline JSX factory pragma |
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.js
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,23 @@ | ||
//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx] //// | ||
|
||
//// [renderer.d.ts] | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
export function dom(): void; | ||
//// [index.tsx] | ||
/** @jsx dom */ | ||
import { dom } from "./renderer"; | ||
<><h></h></> | ||
|
||
//// [index.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
/** @jsx dom */ | ||
var renderer_1 = require("./renderer"); | ||
renderer_1.dom(React.Fragment, null, | ||
renderer_1.dom("h", null)); |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.symbols
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,27 @@ | ||
=== tests/cases/conformance/jsx/inline/renderer.d.ts === | ||
declare global { | ||
>global : Symbol(global, Decl(renderer.d.ts, 0, 0)) | ||
|
||
namespace JSX { | ||
>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) | ||
|
||
interface IntrinsicElements { | ||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) | ||
|
||
[e: string]: any; | ||
>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) | ||
} | ||
} | ||
} | ||
export function dom(): void; | ||
>dom : Symbol(dom, Decl(renderer.d.ts, 6, 1)) | ||
|
||
=== tests/cases/conformance/jsx/inline/index.tsx === | ||
/** @jsx dom */ | ||
import { dom } from "./renderer"; | ||
>dom : Symbol(dom, Decl(index.tsx, 1, 8)) | ||
|
||
<><h></h></> | ||
>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) | ||
>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) | ||
|
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.types
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,29 @@ | ||
=== tests/cases/conformance/jsx/inline/renderer.d.ts === | ||
declare global { | ||
>global : any | ||
|
||
namespace JSX { | ||
>JSX : any | ||
|
||
interface IntrinsicElements { | ||
>IntrinsicElements : IntrinsicElements | ||
|
||
[e: string]: any; | ||
>e : string | ||
} | ||
} | ||
} | ||
export function dom(): void; | ||
>dom : () => void | ||
|
||
=== tests/cases/conformance/jsx/inline/index.tsx === | ||
/** @jsx dom */ | ||
import { dom } from "./renderer"; | ||
>dom : () => void | ||
|
||
<><h></h></> | ||
><><h></h></> : any | ||
><h></h> : any | ||
>h : any | ||
>h : any | ||
|
14 changes: 14 additions & 0 deletions
14
tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx
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,14 @@ | ||
// @jsx: react | ||
// @filename: renderer.d.ts | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[e: string]: any; | ||
} | ||
} | ||
} | ||
export function dom(): void; | ||
// @filename: index.tsx | ||
/** @jsx dom */ | ||
import { dom } from "./renderer"; | ||
<><h></h></> |