Skip to content

Fix 'The operand of a 'delete' operator must be optional' errors in VS Code codebase #96022

Description

@mjbvz

The latest TS 3.9 nightly catches a potential strict null check violation where you delete a property that is not marked optional:

interface Foo {
   x: number;
}

const a: Foo = { x: 3 };

delete a.x // new error here since `x` is not marked as being potentially undefined 

This revealed a few potential errors in our code:

I've made some initial assignments but please reassign if you are not the correct owner

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debtCode quality issues

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions