Skip to content

Ngtsc error shown since last Typescript update #29

Open
@mcarraragh

Description

@mcarraragh

Hi, I've upgraded my Angular project lately (from an earlier 18.X to the 18.2.8) which also upgraded Typescript. Sublime Text is now showing the error "this kind of expression is always falsy" (ngtsc 2873), which is a bit annoying since the code is actually working.

The culprit is the ?. operator whenever I use it on an optional variable. For example: <app-configuration-panel [configuration]="currentApp?.configuration" /> (perfectly valid, the input accepts undefined/null values).

I don't have any TS error if I disable Ngx HTML so I believe that this is the plugin that handles TS's errors in HTML templates. Is there a way to disable specific TS errors? I'd like to keep the ones that cause compilation errors and disable only the 2873. I've tried using tsc-silent but it didn't work.

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions