简体   繁体   中英

how I can disable some ngtsc warnings

After I upgraded my Angular application to v15, some warnings started showing in terminal and chrome devtool Is there any way soI can disable those warnings.

The left side of this optional chain operation does not include 'null' or 'undefined' in its type, therefore the '?.' operator can be replaced with the '.' 
operator.ngtsc(-998107)

You can disable it by adding additional config in tsconfig.json :

"angularCompilerOptions": {
    "extendedDiagnostics": {
      "checks": {
        "optionalChainNotNullable": "suppress"
      }
    }
  }

Or

You can disable it with installing tsc-silent, a package that overrides tsconfig.json and adds additional settings. Do following:

1. npm install -g tsc-silent
2. tsc-silent -p tsconfig.json --suppress 8107@src/js/

Check the documentation for more information: https://github.com/evolution-gaming/tsc-silent

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM