0

For some reason angular.json (@angular/cli@9.1.0) schema is not loaded by WebStorm 2020.1.2. This makes customizing angular.json much harder. This was working in older WebStorm version.

I tried adding the angular.json schema manually, still no success there. Check the attached image bellow.

How to make angular.json schema work in WebStorm 2020.1.2?

WebStorm Settings

Mike
  • 14,010
  • 29
  • 101
  • 161
Hivaga
  • 3,738
  • 4
  • 23
  • 36

1 Answers1

2

To add an Angular JSON schema in IDEA/WebStorm 2020.2:

  1. Go to: File | Settings | Languages & Frameworks | Schemas and DTDs | JSON Schema Mappings.

  2. In the upper left corner, click on + to add a new schema.

  3. Provide a schema name.

  4. In Schema file or URL, set: https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular/cli/lib/config/schema.json.

  5. In Schema version, set JSON Schema version 7.

  6. On the right side of the Settings window, click on + to add all JSON files, which should be processed with this JSON schema:
    JSON Schema Mappings

  7. Press Apply.

That's all! Now IDEA/WebStorm will process your JSONs with the Angular JSON schema including the code suggestions and schema validation:

A schema-processed angular.json

It's also possible to assign a JSON schema via the bottom right corner, click on No JSON schema and select the schema name, you've provided in the step #3:

Angular JSON Schema

Mike
  • 14,010
  • 29
  • 101
  • 161
  • thx for the fast reply, yes I see it in the list and added it from the URL but the problem is that this apparently does not do anything. When I open angular.json still I don't get any hinting. Not sure what the problem is. – Hivaga Jul 08 '20 at 12:46
  • @MikeB.thank you this worked my mistake was I did no added path to the angular.json file inside my project, assumed that webstorm will figure out automatically :) to link angular.json to the provided schema. But your tutorial rocks !!! – Hivaga Jul 09 '20 at 10:29
  • @Hivaga, since in one project there could be multiple JSONs of different types/schemas, IDE requires a manual assignment. – Mike Jul 09 '20 at 10:56