mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-12 23:36:28 -05:00
take issue to throw on
This commit is contained in:
@@ -1673,7 +1673,7 @@ function tryLoadModuleUsingBaseUrl(extensions: Extensions, moduleName: string, l
|
||||
trace(state.host, Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate);
|
||||
}
|
||||
const res = loader(extensions, candidate, !directoryProbablyExists(getDirectoryPath(candidate), state.host), state);
|
||||
if (res) {
|
||||
if (res && state.compilerOptions.issueType === "baseUrl") {
|
||||
throw new Error("TS_FIX_BASEURL_SIGNAL");
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -315,7 +315,6 @@ import {
|
||||
trace,
|
||||
tracing,
|
||||
tryCast,
|
||||
tsFixRootDirSignal,
|
||||
TypeChecker,
|
||||
typeDirectiveIsEqualTo,
|
||||
TypeReferenceDirectiveResolutionCache,
|
||||
@@ -2149,6 +2148,12 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
|
||||
return ts_toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
}
|
||||
|
||||
function tsFixRootDirSignal(kind: string, rootDir: string, rootDir60: string): void {
|
||||
if (options.issueType === "rootDir") {
|
||||
throw new Error(`TS_FIX_ROOTDIR_SIGNAL:: ${kind}:: 5.9:: ${rootDir} 6.0:: ${rootDir60} <End>`);
|
||||
}
|
||||
}
|
||||
|
||||
function getCommonSourceDirectory() {
|
||||
let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory();
|
||||
if (commonSourceDirectory !== undefined) {
|
||||
|
||||
@@ -7395,7 +7395,11 @@ export enum PollingWatchKind {
|
||||
|
||||
export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined; // eslint-disable-line no-restricted-syntax
|
||||
|
||||
/** @internal */
|
||||
export type IssueType = "baseUrl" | "rootDir" | "types";
|
||||
|
||||
export interface CompilerOptions {
|
||||
/** @internal */ issueType?: IssueType;
|
||||
/** @internal */ all?: boolean;
|
||||
allowImportingTsExtensions?: boolean;
|
||||
allowJs?: boolean;
|
||||
|
||||
@@ -6628,11 +6628,6 @@ export function sourceFileMayBeEmitted(sourceFile: SourceFile, host: SourceFileM
|
||||
return true;
|
||||
}
|
||||
|
||||
/**@internal */
|
||||
export function tsFixRootDirSignal(kind: string, rootDir: string, rootDir60: string): void {
|
||||
throw new Error(`TS_FIX_ROOTDIR_SIGNAL:: ${kind}:: 5.9:: ${rootDir} 6.0:: ${rootDir60} <End>`);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function sourceFileMayBeEmitted60(sourceFile: SourceFile, host: SourceFileMayBeEmittedHost, forceDtsEmit?: boolean): boolean {
|
||||
const options = host.getCompilerOptions();
|
||||
|
||||
Reference in New Issue
Block a user