We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
updateJsonFile
1 parent 71b20fb commit 1d1a6beCopy full SHA for 1d1a6be
tests/legacy-cli/e2e/utils/project.ts
@@ -12,7 +12,8 @@ const tsConfigPath = 'tsconfig.base.json';
12
export function updateJsonFile(filePath: string, fn: (json: any) => any | void) {
13
return readFile(filePath)
14
.then(tsConfigJson => {
15
- const tsConfig = JSON.parse(tsConfigJson);
+ // Remove single and multiline comments
16
+ const tsConfig = JSON.parse(tsConfigJson.replace(/\/\*\s(.|\n|\r)*\s\*\/|\/\/.*/g, ''));
17
const result = fn(tsConfig) || tsConfig;
18
19
return writeFile(filePath, JSON.stringify(result, null, 2));
0 commit comments