mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Support wildcard exports in tsconfig lookup (#53443)
This commit is contained in:
parent
f6f6cb893f
commit
7009c76d00
@ -1689,7 +1689,7 @@ export function nodeModuleNameResolver(moduleName: string, containingFile: strin
|
||||
|
||||
/** @internal */
|
||||
export function nodeNextJsonConfigResolver(moduleName: string, containingFile: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations {
|
||||
return nodeModuleNameResolverWorker(NodeResolutionFeatures.Exports, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined);
|
||||
return nodeModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, getDirectoryPath(containingFile), { moduleResolution: ModuleResolutionKind.NodeNext }, host, /*cache*/ undefined, Extensions.Json, /*isConfigLookup*/ true, /*redirectedReference*/ undefined);
|
||||
}
|
||||
|
||||
function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions, isConfigLookup: boolean, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations {
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
/index.ts(2,1): error TS2454: Variable 'x' is used before being assigned.
|
||||
|
||||
|
||||
==== /tsconfig.json (0 errors) ====
|
||||
{
|
||||
"extends": "foo/strict.json"
|
||||
}
|
||||
|
||||
==== /node_modules/foo/package.json (0 errors) ====
|
||||
{
|
||||
"name": "foo",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
"./*.json": "./configs/*.json"
|
||||
}
|
||||
}
|
||||
|
||||
==== /node_modules/foo/configs/strict.json (0 errors) ====
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
||||
==== /index.ts (1 errors) ====
|
||||
let x: string;
|
||||
x.toLowerCase();
|
||||
~
|
||||
!!! error TS2454: Variable 'x' is used before being assigned.
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
// @noTypesAndSymbols: true
|
||||
// @noEmit: true
|
||||
|
||||
// @Filename: /node_modules/foo/package.json
|
||||
{
|
||||
"name": "foo",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
"./*.json": "./configs/*.json"
|
||||
}
|
||||
}
|
||||
|
||||
// @Filename: /node_modules/foo/configs/strict.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
||||
// @Filename: /tsconfig.json
|
||||
{
|
||||
"extends": "foo/strict.json"
|
||||
}
|
||||
|
||||
// @Filename: /index.ts
|
||||
let x: string;
|
||||
x.toLowerCase();
|
||||
Loading…
x
Reference in New Issue
Block a user