Move incorrectly placed fixer

This commit is contained in:
Sheetal Nandi
2025-09-18 16:19:51 -07:00
parent e8c7c7877d
commit b16cb0ed3f
+11 -11
View File
@@ -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) {