4 Commits

Author SHA1 Message Date
Alan Agius
3db588f743 refactor(@schematics/angular): throw on AST parse errors 2020-08-12 19:26:12 +01:00
Charles Lyding
196b3b9f29 fix(@schematics/angular): improve compiler options migration error reporting
This change provides more fine-grained warnings during the `update-module-and-target-compiler-options` migration for V10.0 in the event a TypeScript configuration file could not be updated.  The `JSONFile` utility class was also augmented to directly throw when created to ensure that the `content` property is always initialized.
2020-08-10 09:43:11 +01:00
cexbrayat
ef3bee6e7d fix(@schematics/angular): keep tslint rules ordered
The schematics recently siwtcher to `jsonc-parser` as the JSOn parser, and that introduced a small regression in the tslint.json file where the rules order is not the same as previously.

See https://github.com/cexbrayat/angular-cli-diff/compare/10.0.2...10.1.0-next.0

This commit should fix the issue by providing the insertion index when merging the tslint files.
A test has also been added to avoid further regressions.
2020-07-13 15:54:08 -04:00
Alan Agius
cdff686a76 refactor(@schematics/angular): add jsonc-parser to parse and modify JSON files
Currently, interaction with JSON AST is complex and requires a lot of boiler-platting. With this change we add `jsonc-parser` and add a basic helper class to greatly simplify such interaction.

This would come in handle when writing new migrations in 10.1+

**Note**: this is a private implementation and shouldn't be used by 3rd parties.
2020-07-07 08:45:17 +02:00