mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Move incorrectly placed fixer
This commit is contained in:
@@ -614,17 +614,6 @@ function executeCommandLineWorker(
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
}
|
||||
|
||||
const fixRootDirLogs: string[] = [];
|
||||
try {
|
||||
const fixes = fixRootDirSync(configFileName, log => fixRootDirLogs.push(log));
|
||||
for (const [fileName, text] of Object.entries(fixes)) {
|
||||
sys.writeFile(fileName, text);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error([...fixRootDirLogs, `Error: ${e instanceof Error ? e.message : e}`].join(sys.newLine));
|
||||
}
|
||||
}
|
||||
else if (commandLine.fileNames.length === 0) {
|
||||
const searchPath = normalizePath(sys.getCurrentDirectory());
|
||||
@@ -648,6 +637,17 @@ function executeCommandLineWorker(
|
||||
fileName => getNormalizedAbsolutePath(fileName, currentDirectory),
|
||||
);
|
||||
if (configFileName) {
|
||||
const fixRootDirLogs: string[] = [];
|
||||
try {
|
||||
const fixes = fixRootDirSync(configFileName, log => fixRootDirLogs.push(log));
|
||||
for (const [fileName, text] of Object.entries(fixes)) {
|
||||
sys.writeFile(fileName, text);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error([...fixRootDirLogs, `Error: ${e instanceof Error ? e.message : e}`].join(sys.newLine));
|
||||
}
|
||||
|
||||
const extendedConfigCache = new Map<string, ExtendedConfigCacheEntry>();
|
||||
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic)!; // TODO: GH#18217
|
||||
if (commandLineOptions.showConfig) {
|
||||
|
||||
Reference in New Issue
Block a user