-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Pick PR #60687 (Remove reference not found errors f...) into releas…
…e-5.7 (#60721) Co-authored-by: Isabel Duan <[email protected]>
- Loading branch information
1 parent
c765dce
commit 2d11280
Showing
15 changed files
with
434 additions
and
29 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
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/jsxFragmentFactoryReference(jsx=react).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,15 @@ | ||
jsxFragmentFactoryReference.tsx(3,9): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. | ||
jsxFragmentFactoryReference.tsx(3,9): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. | ||
|
||
|
||
==== jsxFragmentFactoryReference.tsx (2 errors) ==== | ||
export class LoggedOut { | ||
content = () => ( | ||
<></> | ||
~~ | ||
!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. | ||
~~ | ||
!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. | ||
) | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsx).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,12 @@ | ||
jsxFragmentFactoryReference.tsx(3,9): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? | ||
|
||
|
||
==== jsxFragmentFactoryReference.tsx (1 errors) ==== | ||
export class LoggedOut { | ||
content = () => ( | ||
<></> | ||
~~ | ||
!!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? | ||
) | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsxdev).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,12 @@ | ||
jsxFragmentFactoryReference.tsx(3,9): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? | ||
|
||
|
||
==== jsxFragmentFactoryReference.tsx (1 errors) ==== | ||
export class LoggedOut { | ||
content = () => ( | ||
<></> | ||
~~ | ||
!!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? | ||
) | ||
} | ||
|
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsx).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
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsxdev).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
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
88 changes: 88 additions & 0 deletions
88
tests/baselines/reference/jsxRuntimePragma(jsx=preserve).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,88 @@ | ||
//// [tests/cases/compiler/jsxRuntimePragma.ts] //// | ||
|
||
//// [one.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
import * as React from "react"; | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
export const frag = <><div></div></>; | ||
export const selfClosing = <img src="./image.png" />; | ||
//// [two.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
export const frag = <><div></div></>; | ||
export const selfClosing = <img src="./image.png" />; | ||
//// [three.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
/* @jsxRuntime automatic */ | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
export const frag = <><div></div></>; | ||
export const selfClosing = <img src="./image.png" />; | ||
//// [four.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
/* @jsxRuntime classic */ | ||
import * as React from "react"; | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
export const frag = <><div></div></>; | ||
export const selfClosing = <img src="./image.png" />; | ||
//// [index.ts] | ||
export * as one from "./one.js"; | ||
export * as two from "./two.js"; | ||
export * as three from "./three.js"; | ||
export * as four from "./four.js"; | ||
|
||
//// [one.jsx] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.selfClosing = exports.frag = exports.HelloWorld = void 0; | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
var React = require("react"); | ||
var HelloWorld = function () { return <h1>Hello world</h1>; }; | ||
exports.HelloWorld = HelloWorld; | ||
exports.frag = <><div></div></>; | ||
exports.selfClosing = <img src="./image.png"/>; | ||
//// [two.jsx] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.selfClosing = exports.frag = exports.HelloWorld = void 0; | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
var HelloWorld = function () { return <h1>Hello world</h1>; }; | ||
exports.HelloWorld = HelloWorld; | ||
exports.frag = <><div></div></>; | ||
exports.selfClosing = <img src="./image.png"/>; | ||
//// [three.jsx] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.selfClosing = exports.frag = exports.HelloWorld = void 0; | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
/* @jsxRuntime automatic */ | ||
var HelloWorld = function () { return <h1>Hello world</h1>; }; | ||
exports.HelloWorld = HelloWorld; | ||
exports.frag = <><div></div></>; | ||
exports.selfClosing = <img src="./image.png"/>; | ||
//// [four.jsx] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.selfClosing = exports.frag = exports.HelloWorld = void 0; | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
/* @jsxRuntime classic */ | ||
var React = require("react"); | ||
var HelloWorld = function () { return <h1>Hello world</h1>; }; | ||
exports.HelloWorld = HelloWorld; | ||
exports.frag = <><div></div></>; | ||
exports.selfClosing = <img src="./image.png"/>; | ||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.four = exports.three = exports.two = exports.one = void 0; | ||
exports.one = require("./one.js"); | ||
exports.two = require("./two.js"); | ||
exports.three = require("./three.js"); | ||
exports.four = require("./four.js"); |
95 changes: 95 additions & 0 deletions
95
tests/baselines/reference/jsxRuntimePragma(jsx=preserve).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,95 @@ | ||
//// [tests/cases/compiler/jsxRuntimePragma.ts] //// | ||
|
||
=== one.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
import * as React from "react"; | ||
>React : Symbol(React, Decl(one.tsx, 2, 6)) | ||
|
||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
>HelloWorld : Symbol(HelloWorld, Decl(one.tsx, 3, 12)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
|
||
export const frag = <><div></div></>; | ||
>frag : Symbol(frag, Decl(one.tsx, 4, 12)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
|
||
export const selfClosing = <img src="./image.png" />; | ||
>selfClosing : Symbol(selfClosing, Decl(one.tsx, 5, 12)) | ||
>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) | ||
>src : Symbol(src, Decl(one.tsx, 5, 31)) | ||
|
||
=== two.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
>HelloWorld : Symbol(HelloWorld, Decl(two.tsx, 2, 12)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
|
||
export const frag = <><div></div></>; | ||
>frag : Symbol(frag, Decl(two.tsx, 3, 12)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
|
||
export const selfClosing = <img src="./image.png" />; | ||
>selfClosing : Symbol(selfClosing, Decl(two.tsx, 4, 12)) | ||
>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) | ||
>src : Symbol(src, Decl(two.tsx, 4, 31)) | ||
|
||
=== three.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime classic */ | ||
/* @jsxRuntime automatic */ | ||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
>HelloWorld : Symbol(HelloWorld, Decl(three.tsx, 3, 12)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
|
||
export const frag = <><div></div></>; | ||
>frag : Symbol(frag, Decl(three.tsx, 4, 12)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
|
||
export const selfClosing = <img src="./image.png" />; | ||
>selfClosing : Symbol(selfClosing, Decl(three.tsx, 5, 12)) | ||
>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) | ||
>src : Symbol(src, Decl(three.tsx, 5, 31)) | ||
|
||
=== four.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
/* @jsxRuntime automatic */ | ||
/* @jsxRuntime classic */ | ||
import * as React from "react"; | ||
>React : Symbol(React, Decl(four.tsx, 3, 6)) | ||
|
||
export const HelloWorld = () => <h1>Hello world</h1>; | ||
>HelloWorld : Symbol(HelloWorld, Decl(four.tsx, 4, 12)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) | ||
|
||
export const frag = <><div></div></>; | ||
>frag : Symbol(frag, Decl(four.tsx, 5, 12)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) | ||
|
||
export const selfClosing = <img src="./image.png" />; | ||
>selfClosing : Symbol(selfClosing, Decl(four.tsx, 6, 12)) | ||
>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) | ||
>src : Symbol(src, Decl(four.tsx, 6, 31)) | ||
|
||
=== index.ts === | ||
export * as one from "./one.js"; | ||
>one : Symbol(one, Decl(index.ts, 0, 6)) | ||
|
||
export * as two from "./two.js"; | ||
>two : Symbol(two, Decl(index.ts, 1, 6)) | ||
|
||
export * as three from "./three.js"; | ||
>three : Symbol(three, Decl(index.ts, 2, 6)) | ||
|
||
export * as four from "./four.js"; | ||
>four : Symbol(four, Decl(index.ts, 3, 6)) | ||
|
Oops, something went wrong.