Skip to content

Commit 57ff76f

Browse files
committed
fix(tsconfig) rewriteTsconfig should be true by default
closes #732
1 parent fb5165d commit 57ff76f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dist/main/tsconfig/tsconfig.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,14 @@ function getProjectSync(pathOrSrcFile) {
213213
catch (ex) {
214214
throw errorWithDetails(new Error(exports.errors.GET_PROJECT_JSON_PARSE_FAILED), { projectFilePath: fsu.consistentPath(projectFile), error: ex.message });
215215
}
216+
if (!projectSpec.atom) {
217+
projectSpec.atom = {
218+
rewriteTsconfig: true,
219+
};
220+
}
216221
if (projectSpec.filesGlob) {
217222
var prettyJSONProjectSpec = prettyJSON(projectSpec, detectIndent(projectFileTextContent).indent);
218-
if (prettyJSONProjectSpec !== projectFileTextContent && projectSpec.atom && projectSpec.atom.rewriteTsconfig) {
223+
if (prettyJSONProjectSpec !== projectFileTextContent && projectSpec.atom.rewriteTsconfig) {
219224
fs.writeFileSync(projectFile, prettyJSONProjectSpec);
220225
}
221226
}

lib/main/tsconfig/tsconfig.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,17 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
396396
new Error(errors.GET_PROJECT_JSON_PARSE_FAILED), { projectFilePath: fsu.consistentPath(projectFile), error: ex.message });
397397
}
398398

399+
/** Setup defaults for atom key */
400+
if (!projectSpec.atom) {
401+
projectSpec.atom = {
402+
rewriteTsconfig: true,
403+
}
404+
}
405+
399406
if (projectSpec.filesGlob) { // for filesGlob we keep the files in sync
400407
var prettyJSONProjectSpec = prettyJSON(projectSpec, detectIndent(projectFileTextContent).indent);
401408

402-
if (prettyJSONProjectSpec !== projectFileTextContent && projectSpec.atom && projectSpec.atom.rewriteTsconfig) {
409+
if (prettyJSONProjectSpec !== projectFileTextContent && projectSpec.atom.rewriteTsconfig) {
403410
fs.writeFileSync(projectFile, prettyJSONProjectSpec);
404411
}
405412
}

0 commit comments

Comments
 (0)