Skip to content

Commit 0a45b40

Browse files
committed
Add test
1 parent 3163fe7 commit 0a45b40

File tree

5 files changed

+88
-0
lines changed

5 files changed

+88
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
file.tsx(3,1): error TS6133: 'React' is declared but its value is never read.
2+
3+
4+
==== file.tsx (1 errors) ====
5+
/// <reference path="/.lib/react16.d.ts" />
6+
7+
import React from 'react';
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
!!! error TS6133: 'React' is declared but its value is never read.
10+
11+
export function Component1() {
12+
return <div />;
13+
}
14+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [tests/cases/conformance/jsx/jsxReactReferencedImport.ts] ////
2+
3+
//// [file.tsx]
4+
/// <reference path="/.lib/react16.d.ts" />
5+
6+
import React from 'react';
7+
8+
export function Component1() {
9+
return <div />;
10+
}
11+
12+
13+
//// [file.js]
14+
/// <reference path="react16.d.ts" />
15+
import React from 'react';
16+
export function Component1() {
17+
return React.createElement("div", null);
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//// [tests/cases/conformance/jsx/jsxReactReferencedImport.ts] ////
2+
3+
=== file.tsx ===
4+
/// <reference path="react16.d.ts" />
5+
6+
import React from 'react';
7+
>React : Symbol(React, Decl(file.tsx, 2, 6))
8+
9+
export function Component1() {
10+
>Component1 : Symbol(Component1, Decl(file.tsx, 2, 26))
11+
12+
return <div />;
13+
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
14+
}
15+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [tests/cases/conformance/jsx/jsxReactReferencedImport.ts] ////
2+
3+
=== Performance Stats ===
4+
Assignability cache: 2,500
5+
Type Count: 5,000
6+
Instantiation count: 50,000
7+
Symbol count: 50,000
8+
9+
=== file.tsx ===
10+
/// <reference path="react16.d.ts" />
11+
12+
import React from 'react';
13+
>React : typeof React
14+
> : ^^^^^^^^^^^^
15+
16+
export function Component1() {
17+
>Component1 : () => JSX.Element
18+
> : ^^^^^^^^^^^^^^^^^
19+
20+
return <div />;
21+
><div /> : JSX.Element
22+
> : ^^^^^^^^^^^
23+
>div : any
24+
> : ^^^
25+
}
26+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @filename: file.tsx
2+
// @jsx: react
3+
// @module: esnext
4+
// @allowSyntheticDefaultImports: true
5+
// @noUnusedLocals: true
6+
// @noUnusedParameters: true
7+
// @verbatimModuleSyntax: true
8+
9+
/// <reference path="/.lib/react16.d.ts" />
10+
11+
import React from 'react';
12+
13+
export function Component1() {
14+
return <div />;
15+
}

0 commit comments

Comments
 (0)