mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Add test for non-used React import
This commit is contained in:
24
tests/baselines/reference/tsxPreserveEmit3.js
Normal file
24
tests/baselines/reference/tsxPreserveEmit3.js
Normal file
@@ -0,0 +1,24 @@
|
||||
//// [tests/cases/conformance/jsx/tsxPreserveEmit3.tsx] ////
|
||||
|
||||
//// [file.tsx]
|
||||
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
//// [test.d.ts]
|
||||
export var React;
|
||||
|
||||
//// [react-consumer.tsx]
|
||||
// This import should be elided
|
||||
import {React} from "./test";
|
||||
|
||||
|
||||
//// [file.jsx]
|
||||
//// [react-consumer.jsx]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
});
|
||||
25
tests/baselines/reference/tsxPreserveEmit3.symbols
Normal file
25
tests/baselines/reference/tsxPreserveEmit3.symbols
Normal file
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/conformance/jsx/file.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
|
||||
|
||||
interface Element { }
|
||||
>Element : Symbol(Element, Decl(file.tsx, 1, 20))
|
||||
|
||||
interface IntrinsicElements {
|
||||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22))
|
||||
|
||||
[s: string]: any;
|
||||
>s : Symbol(s, Decl(file.tsx, 4, 3))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/test.d.ts ===
|
||||
export var React;
|
||||
>React : Symbol(React, Decl(test.d.ts, 0, 10))
|
||||
|
||||
=== tests/cases/conformance/jsx/react-consumer.tsx ===
|
||||
// This import should be elided
|
||||
import {React} from "./test";
|
||||
>React : Symbol(React, Decl(react-consumer.tsx, 1, 8))
|
||||
|
||||
25
tests/baselines/reference/tsxPreserveEmit3.types
Normal file
25
tests/baselines/reference/tsxPreserveEmit3.types
Normal file
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/conformance/jsx/file.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : any
|
||||
|
||||
interface Element { }
|
||||
>Element : Element
|
||||
|
||||
interface IntrinsicElements {
|
||||
>IntrinsicElements : IntrinsicElements
|
||||
|
||||
[s: string]: any;
|
||||
>s : string
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/test.d.ts ===
|
||||
export var React;
|
||||
>React : any
|
||||
|
||||
=== tests/cases/conformance/jsx/react-consumer.tsx ===
|
||||
// This import should be elided
|
||||
import {React} from "./test";
|
||||
>React : any
|
||||
|
||||
17
tests/cases/conformance/jsx/tsxPreserveEmit3.tsx
Normal file
17
tests/cases/conformance/jsx/tsxPreserveEmit3.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
//@jsx: preserve
|
||||
//@module: amd
|
||||
|
||||
//@filename: file.tsx
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
//@filename: test.d.ts
|
||||
export var React;
|
||||
|
||||
//@filename: react-consumer.tsx
|
||||
// This import should be elided
|
||||
import {React} from "./test";
|
||||
Reference in New Issue
Block a user