Angular compiler does not report template error but IntelliJ does

Viewed 259

I know there's a similar question here: Angular Compiler not reporting missing property in template

But I already have set strictTemplates: true in my tsconfig.json:

// tsconfig.json
{
  "compilerOptions": {
   ...
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "strictTemplates": true
  }
}

// tsconfig.app.json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
}

// angular.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "",
  "projects": {
    "myProject": {
      ...
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            ...
          },
          "configurations": {
            "production": {
              ...
              "tsConfig": "./tsconfig.json",
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "designa-client:build",
            "host": "0.0.0.0"
          },
          "configurations": {
            "production": {
              "browserTarget": "designa-client:build:production"
            }
          }
        },
        ...
      }
    }
  },
}

I thought with strictTemplates set to true all template errors should be set to true, but somehow the Angular compiler still lets the following template through:

<pmt-placed-products-list
  [products]="products"
></pmt-placed-products-list>

Whereas IntelliJ (correctly!!) complains that there is no @Input property products:

enter image description here

There really is an error in the template which IntelliJ detects, but the Angular compiler doesn't! I'm using Angular 11 btw, so Ivy should be the default compiler.

0 Answers
Related