Skip to content

Commit b345c3a

Browse files
TypeScript Botandrewbranch
TypeScript Bot
andauthored
🤖 Pick PR #53443 (Support wildcard exports in tsconfi...) into release-5.0 (#53557)
Co-authored-by: Andrew Branch <[email protected]>
1 parent aebd31b commit b345c3a

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

Diff for: ‎src/compiler/moduleNameResolver.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ export function nodeModuleNameResolver(moduleName: string, containingFile: strin
16791679

16801680
/** @internal */
16811681
export function nodeNextJsonConfigResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations {
1682-
return nodeModuleNameResolverWorker(NodeResolutionFeatures.Exports, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined);
1682+
return nodeModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined);
16831683
}
16841684

16851685
function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions, isConfigLookup: boolean, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/index.ts(2,1): error TS2454: Variable 'x' is used before being assigned.
2+
3+
4+
==== /tsconfig.json (0 errors) ====
5+
{
6+
"extends": "foo/strict.json"
7+
}
8+
9+
==== /node_modules/foo/package.json (0 errors) ====
10+
{
11+
"name": "foo",
12+
"version": "1.0.0",
13+
"exports": {
14+
"./*.json": "./configs/*.json"
15+
}
16+
}
17+
18+
==== /node_modules/foo/configs/strict.json (0 errors) ====
19+
{
20+
"compilerOptions": {
21+
"strict": true
22+
}
23+
}
24+
25+
==== /index.ts (1 errors) ====
26+
let x: string;
27+
x.toLowerCase();
28+
~
29+
!!! error TS2454: Variable 'x' is used before being assigned.
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @noTypesAndSymbols: true
2+
// @noEmit: true
3+
4+
// @Filename: /node_modules/foo/package.json
5+
{
6+
"name": "foo",
7+
"version": "1.0.0",
8+
"exports": {
9+
"./*.json": "./configs/*.json"
10+
}
11+
}
12+
13+
// @Filename: /node_modules/foo/configs/strict.json
14+
{
15+
"compilerOptions": {
16+
"strict": true
17+
}
18+
}
19+
20+
// @Filename: /tsconfig.json
21+
{
22+
"extends": "foo/strict.json"
23+
}
24+
25+
// @Filename: /index.ts
26+
let x: string;
27+
x.toLowerCase();

0 commit comments

Comments
 (0)