Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress Angular Language Service VSCode extension's "strictTemplates in angularCompilerOptions" notification

Tags:

Since we upgraded our codebase to Angular 11 I get this message in VSCode:

Some language features are not available. To access all features, enable strictTemplates in angularCompilerOptions.

Source: Angular Language Service (Extension)

With a link to "Open tsconfig.json", like this:

visualization of above described text

I'm looking forward to enabling this and enjoying the new feature. But I want to set time apart to do and test this. For now, the popup in VSCode keeps coming up all the time, which is annoying and distracting.

How can I (for now) suppress this message, preferably for my current workspace?


  • Angular Language Service (angular.ng-template) v11.2.3
  • Visual Studio Code version 1.53.2 on Windows 10
like image 643
Jeroen Avatar asked Feb 24 '21 11:02

Jeroen


People also ask

What is the angular for Visual Studio Code Extension?

This extension for Visual Studio Code adds snippets for Angular for TypeScript and HTML. This extension for Visual Studio Code saves a lot of time by adding snippets for Angular for TypeScript and HTML. It can be used with vs code 0.10.1 version or higher.

What options does the angular language service use to compile the application?

The Angular Language Service uses the same set of options that are used to compile the application. To get the most complete information in the editor, set the strictTemplates option in tsconfig.json , as shown in the following example:

What is stricttemplates in angular 9?

When strictTemplates is true, Angular 9 and the Ivy compiler verify that hero is a valid model of type Hero, and that the properties on that model ( hero. id and hero. name) are also valid. "Angular 9's Ivy compiler and the strict template check finds errors that Angular 8 could not detect."

Why does @angular/language-service not work with typescript?

If the typescript package is loaded by methods (1) or (3), there is a potential for a mismatch between the API expected by @angular/language-service and the API provided by typescript. This could lead to a failure of the language service extension.


1 Answers

Hi guys I had the same problem but I did this and that message stopped showing... I hope help us.

tsconfig.json

{   "extends": "../../tsconfig.json",   "compilerOptions": {     "types": ["node", "jest"]   },   "include": [...],   "angularCompilerOptions": {     "strictTemplates": true   } } 

Configuration

like image 171
Jeison Nisperuza Avatar answered Oct 07 '22 20:10

Jeison Nisperuza