use less strict parser for JSON. tsconfig is in less restictive format (#87658) (#87700)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Mikhail Shustov 2021-01-08 07:37:48 +01:00 committed by GitHub
parent f223b2db42
commit 27412dea98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@
import Path from 'path';
import Fs from 'fs';
import JSON5 from 'json5';
import { get } from 'lodash';
import { run } from '@kbn/dev-utils';
import { getPluginDeps, findPlugins } from './plugin_discovery';
@ -88,7 +89,7 @@ function isMigratedToTsProjectRefs(dir: string): boolean {
try {
const path = Path.join(dir, 'tsconfig.json');
const content = Fs.readFileSync(path, { encoding: 'utf8' });
return get(JSON.parse(content), 'compilerOptions.composite', false);
return get(JSON5.parse(content), 'compilerOptions.composite', false);
} catch (e) {
return false;
}