Make `emitModuleKindIsNonNodeESM` internal (#52599)
This commit is contained in:
Родитель
1ed0a5ac4b
Коммит
0bf99914e7
|
@ -3066,6 +3066,7 @@ export function classicNameResolver(moduleName: string, containingFile: string,
|
|||
|
||||
// Program errors validate that `noEmit` or `emitDeclarationOnly` is also set,
|
||||
// so this function doesn't check them to avoid propagating errors.
|
||||
/** @internal */
|
||||
export function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string) {
|
||||
return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
|
||||
}
|
||||
|
|
|
@ -7989,6 +7989,7 @@ export function getEmitModuleKind(compilerOptions: {module?: CompilerOptions["mo
|
|||
getEmitScriptTarget(compilerOptions) >= ScriptTarget.ES2015 ? ModuleKind.ES2015 : ModuleKind.CommonJS;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind) {
|
||||
return moduleKind >= ModuleKind.ES2015 && moduleKind <= ModuleKind.ESNext;
|
||||
}
|
||||
|
|
|
@ -8689,7 +8689,6 @@ declare namespace ts {
|
|||
parent: ConstructorDeclaration;
|
||||
name: Identifier;
|
||||
};
|
||||
function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean;
|
||||
/** @deprecated */
|
||||
function createUnparsedSourceFile(text: string): UnparsedSource;
|
||||
/** @deprecated */
|
||||
|
@ -9144,7 +9143,6 @@ declare namespace ts {
|
|||
function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined;
|
||||
interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, NonRelativeNameResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
}
|
||||
interface ModeAwareCache<T> {
|
||||
|
|
|
@ -4714,7 +4714,6 @@ declare namespace ts {
|
|||
parent: ConstructorDeclaration;
|
||||
name: Identifier;
|
||||
};
|
||||
function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean;
|
||||
/** @deprecated */
|
||||
function createUnparsedSourceFile(text: string): UnparsedSource;
|
||||
/** @deprecated */
|
||||
|
@ -5169,7 +5168,6 @@ declare namespace ts {
|
|||
function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function shouldAllowImportingTsExtension(compilerOptions: CompilerOptions, fromFileName?: string): boolean | "" | undefined;
|
||||
interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, NonRelativeNameResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
}
|
||||
interface ModeAwareCache<T> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче