diff --git a/packages/nx/src/utils/json.ts b/packages/nx/src/utils/json.ts index 64e4fe1f64a44d..65d7b3b6f36576 100644 --- a/packages/nx/src/utils/json.ts +++ b/packages/nx/src/utils/json.ts @@ -44,7 +44,9 @@ export function parseJson( options?: JsonParseOptions ): T { try { - return JSON.parse(input); + if (options?.expectComments !== true) { + return JSON.parse(input); + } } catch {} options = { allowTrailingComma: true, ...options };