File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
projects/igniteui-angular/migrations/common Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -489,16 +489,15 @@ export class UpdateChanges {
489489 return ;
490490 }
491491 let content ;
492- try {
493- // there could be comments in the json file and JSON.parse would fail
494- // TODO: use some 3rd party parser or write our own.
495- // @angular -devkit/core.parseJson is deprecated
496- content = JSON . parse ( originalContent ) ;
497- } catch ( e : any ) {
492+ // use ts parser as it handles jsonc-style files w/ comments
493+ const result = ts . parseConfigFileTextToJson ( TSCONFIG_PATH , originalContent ) ;
494+ if ( ! result . error ) {
495+ content = result . config ;
496+ } else {
498497 this . context ?. logger
499498 . warn ( `Could not parse ${ TSCONFIG_PATH } . Angular Ivy language service might be unavailable during migrations.` ) ;
500499 this . context ?. logger
501- . warn ( `Error:\n${ e } ` ) ;
500+ . warn ( `Error:\n${ result . error } ` ) ;
502501 return ;
503502 }
504503 if ( ! content . angularCompilerOptions ) {
You can’t perform that action at this time.
0 commit comments