Set import mode on synthetic imports (#46327)

This commit is contained in:
Wesley Wigham 2021-10-12 16:23:37 -07:00 committed by GitHub
parent 9e2fc16c32
commit 713afe2227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 449 additions and 1 deletions

View file

@ -3416,7 +3416,8 @@ namespace ts {
findAncestor(location, isExportDeclaration)?.moduleSpecifier ||
(isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)?.name ||
(isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal;
const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : undefined)!; // TODO: GH#18217
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode)!; // TODO: GH#18217
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule);
const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
if (sourceFile) {

View file

@ -0,0 +1,27 @@
//// [tests/cases/compiler/reactJsxReactResolvedNodeNext.tsx] ////
//// [file.tsx]
export const a = <div></div>;
//// [package.json]
{
"name": "@types/react",
"version": "0.0.1",
"main": "",
"types": "index.d.ts",
}
//// [index.d.ts]
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
}
//// [jsx-runtime.d.ts]
import './';
//// [jsx-dev-runtime.d.ts]
import './';
//// [file.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
exports.a = (0, jsx_runtime_1.jsx)("div", {}, void 0);

View file

@ -0,0 +1,20 @@
=== tests/cases/compiler/file.tsx ===
export const a = <div></div>;
>a : Symbol(a, Decl(file.tsx, 0, 12))
>div : Symbol(JSX.IntrinsicElements, Decl(index.d.ts, 0, 23))
>div : Symbol(JSX.IntrinsicElements, Decl(index.d.ts, 0, 23))
=== tests/cases/compiler/node_modules/@types/react/index.d.ts ===
declare namespace JSX {
>JSX : Symbol(JSX, Decl(index.d.ts, 0, 0))
interface IntrinsicElements { [x: string]: any; }
>IntrinsicElements : Symbol(IntrinsicElements, Decl(index.d.ts, 0, 23))
>x : Symbol(x, Decl(index.d.ts, 1, 35))
}
=== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts ===
import './';
No type information for this code.=== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts ===
import './';
No type information for this code.
No type information for this code.

View file

@ -0,0 +1,135 @@
[
"File 'tests/cases/compiler/package.json' does not exist.",
"File 'tests/cases/package.json' does not exist.",
"File 'tests/package.json' does not exist.",
"File 'package.json' does not exist.",
"File '/package.json' does not exist.",
"======== Resolving module 'react/jsx-runtime' from 'tests/cases/compiler/file.tsx'. ========",
"Module resolution kind is not specified, using 'NodeNext'.",
"File 'tests/cases/compiler/package.json' does not exist according to earlier cached lookups.",
"File 'tests/cases/package.json' does not exist according to earlier cached lookups.",
"File 'tests/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'react/jsx-runtime' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at 'tests/cases/compiler/node_modules/@types/react/package.json'.",
"'package.json' does not have a 'typesVersions' field.",
"File 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts' exist - use it as a name resolution result.",
"Resolving real path for 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts', result 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'.",
"======== Module name 'react/jsx-runtime' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts' with Package ID '@types/react/jsx-runtime.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeNext'.",
"Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file type 'TypeScript'.",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'index.d.ts' that references 'tests/cases/compiler/node_modules/@types/react/index.d.ts'.",
"File 'tests/cases/compiler/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========",
"Resolution for module './' was found in cache from location 'tests/cases/compiler/node_modules/@types/react'.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts'. ========",
"Resolution for module './' was found in cache from location 'tests/cases/compiler/node_modules/@types/react'.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'package.json' does not exist.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]

View file

@ -0,0 +1,18 @@
=== tests/cases/compiler/file.tsx ===
export const a = <div></div>;
>a : error
><div></div> : error
>div : any
>div : any
=== tests/cases/compiler/node_modules/@types/react/index.d.ts ===
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
>x : string
}
=== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts ===
import './';
No type information for this code.=== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts ===
import './';
No type information for this code.
No type information for this code.

View file

@ -0,0 +1,32 @@
//// [tests/cases/compiler/reactJsxReactResolvedNodeNextEsm.tsx] ////
//// [package.json]
{
"type": "module"
}
//// [file.tsx]
export const a = <div></div>;
//// [package.json]
{
"name": "@types/react",
"version": "0.0.1",
"main": "",
"types": "index.d.ts",
"exports": {
"./*.js": "./*.js",
"./*": "./*.js"
}
}
//// [index.d.ts]
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
}
//// [jsx-runtime.d.ts]
import './';
//// [jsx-dev-runtime.d.ts]
import './';
//// [file.js]
import { jsx as _jsx } from "react/jsx-runtime";
export const a = _jsx("div", {}, void 0);

View file

@ -0,0 +1,20 @@
=== tests/cases/compiler/file.tsx ===
export const a = <div></div>;
>a : Symbol(a, Decl(file.tsx, 0, 12))
>div : Symbol(JSX.IntrinsicElements, Decl(index.d.ts, 0, 23))
>div : Symbol(JSX.IntrinsicElements, Decl(index.d.ts, 0, 23))
=== tests/cases/compiler/node_modules/@types/react/index.d.ts ===
declare namespace JSX {
>JSX : Symbol(JSX, Decl(index.d.ts, 0, 0))
interface IntrinsicElements { [x: string]: any; }
>IntrinsicElements : Symbol(IntrinsicElements, Decl(index.d.ts, 0, 23))
>x : Symbol(x, Decl(index.d.ts, 1, 35))
}
=== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts ===
import './';
No type information for this code.=== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts ===
import './';
No type information for this code.
No type information for this code.

View file

@ -0,0 +1,129 @@
[
"Found 'package.json' at 'tests/cases/compiler/package.json'.",
"'package.json' does not have a 'typesVersions' field.",
"======== Resolving module 'react/jsx-runtime' from 'tests/cases/compiler/file.tsx'. ========",
"Module resolution kind is not specified, using 'NodeNext'.",
"File 'tests/cases/compiler/package.json' exists according to earlier cached lookups.",
"Loading module 'react/jsx-runtime' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at 'tests/cases/compiler/node_modules/@types/react/package.json'.",
"'package.json' does not have a 'typesVersions' field.",
"File name 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.js' has a '.js' extension - stripping it.",
"File 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts' exist - use it as a name resolution result.",
"Resolving real path for 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts', result 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'.",
"======== Module name 'react/jsx-runtime' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts' with Package ID '@types/react/jsx-runtime.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeNext'.",
"Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file type 'TypeScript'.",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'index.d.ts' that references 'tests/cases/compiler/node_modules/@types/react/index.d.ts'.",
"File 'tests/cases/compiler/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========",
"Resolution for module './' was found in cache from location 'tests/cases/compiler/node_modules/@types/react'.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.",
"======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts'. ========",
"Resolution for module './' was found in cache from location 'tests/cases/compiler/node_modules/@types/react'.",
"======== Module name './' was successfully resolved to 'tests/cases/compiler/node_modules/@types/react/index.d.ts' with Package ID '@types/react/index.d.ts@0.0.1'. ========",
"File 'package.json' does not exist.",
"File '/package.json' does not exist.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]

View file

@ -0,0 +1,18 @@
=== tests/cases/compiler/file.tsx ===
export const a = <div></div>;
>a : error
><div></div> : error
>div : any
>div : any
=== tests/cases/compiler/node_modules/@types/react/index.d.ts ===
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
>x : string
}
=== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts ===
import './';
No type information for this code.=== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts ===
import './';
No type information for this code.
No type information for this code.

View file

@ -0,0 +1,20 @@
// @jsx: react-jsx
// @module: nodenext
// @traceResolution: true
// @filename: file.tsx
export const a = <div></div>;
// @filename: node_modules/@types/react/package.json
{
"name": "@types/react",
"version": "0.0.1",
"main": "",
"types": "index.d.ts",
}
// @filename: node_modules/@types/react/index.d.ts
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
}
// @filename: node_modules/@types/react/jsx-runtime.d.ts
import './';
// @filename: node_modules/@types/react/jsx-dev-runtime.d.ts
import './';

View file

@ -0,0 +1,28 @@
// @jsx: react-jsx
// @module: nodenext
// @traceResolution: true
// @filename: package.json
{
"type": "module"
}
// @filename: file.tsx
export const a = <div></div>;
// @filename: node_modules/@types/react/package.json
{
"name": "@types/react",
"version": "0.0.1",
"main": "",
"types": "index.d.ts",
"exports": {
"./*.js": "./*.js",
"./*": "./*.js"
}
}
// @filename: node_modules/@types/react/index.d.ts
declare namespace JSX {
interface IntrinsicElements { [x: string]: any; }
}
// @filename: node_modules/@types/react/jsx-runtime.d.ts
import './';
// @filename: node_modules/@types/react/jsx-dev-runtime.d.ts
import './';