Skip to content

Commit c60ce01

Browse files
committed
fix
1 parent 2be191e commit c60ce01

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

src/test/module-node/1778.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const test = context(ctxTsNode);
1919
test.suite(
2020
'Issue #1778: typechecker resolver should take importer\'s module type -- cjs or esm -- into account when resolving package.json "exports"',
2121
(test) => {
22-
test.runIf(nodeSupportsEsmHooks && nodeSupportsSpawningChildProcess && tsSupportsStableNodeNextNode16);
22+
test.runIf(
23+
nodeSupportsEsmHooks &&
24+
nodeSupportsSpawningChildProcess &&
25+
tsSupportsStableNodeNextNode16
26+
);
2327
test('test', async () => {
2428
const { err, stdout } = await exec(
2529
`${CMD_TS_NODE_WITHOUT_PROJECT_FLAG} ./index.ts`,

src/ts-compiler-types.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,7 @@ export interface TSCommon {
3232
createModuleResolutionCache: typeof _ts.createModuleResolutionCache;
3333
resolveModuleName: typeof _ts.resolveModuleName;
3434
resolveModuleNameFromCache: typeof _ts.resolveModuleNameFromCache;
35-
// Changed in TS 4.7
36-
resolveTypeReferenceDirective(
37-
typeReferenceDirectiveName: string,
38-
containingFile: string | undefined,
39-
options: _ts.CompilerOptions,
40-
host: _ts.ModuleResolutionHost,
41-
redirectedReference?: _ts.ResolvedProjectReference,
42-
cache?: _ts.TypeReferenceDirectiveResolutionCache,
43-
resolutionMode?: _ts.SourceFile['impliedNodeFormat']
44-
): _ts.ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
35+
resolveTypeReferenceDirective: typeof _ts.resolveTypeReferenceDirective;
4536
createIncrementalCompilerHost: typeof _ts.createIncrementalCompilerHost;
4637
createSourceFile: typeof _ts.createSourceFile;
4738
getDefaultLibFileName: typeof _ts.getDefaultLibFileName;
@@ -52,16 +43,7 @@ export interface TSCommon {
5243
ModuleResolutionKind: typeof _ts.ModuleResolutionKind;
5344
}
5445
export namespace TSCommon {
55-
export interface LanguageServiceHost extends _ts.LanguageServiceHost {
56-
// Modified in 4.7
57-
resolveTypeReferenceDirectives?(
58-
typeDirectiveNames: string[] | _ts.FileReference[],
59-
containingFile: string,
60-
redirectedReference: _ts.ResolvedProjectReference | undefined,
61-
options: _ts.CompilerOptions,
62-
containingFileMode?: _ts.SourceFile['impliedNodeFormat'] | undefined
63-
): (_ts.ResolvedTypeReferenceDirective | undefined)[];
64-
}
46+
export interface LanguageServiceHost extends _ts.LanguageServiceHost {}
6547
export type ModuleResolutionHost = _ts.ModuleResolutionHost;
6648
export type ParsedCommandLine = _ts.ParsedCommandLine;
6749
export type ResolvedModule = _ts.ResolvedModule;

0 commit comments

Comments
 (0)