We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent delete non-optional property
inferface Test{ value: number } const foo: Test = { value:1 }
foo.value = undefined [ts] Type 'undefined' is not assignable to type 'number'. [2322] the compiler reported error, everything is normal
foo.value = undefined
[ts] Type 'undefined' is not assignable to type 'number'. [2322]
delete foo.value; The complier should be prevent this situation, it behaviors like the foo.value = undefined, but here complier reported not error.
delete foo.value;
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
Related to #26549 and probably a duplicate of #13783
There's a lint rule to disallow delete on non-optional properties: https://github.com/fimbullinter/wotan/blob/master/packages/mimir/docs/delete-only-optional-property.md (CLI documentation)
Sorry, something went wrong.
No branches or pull requests
Search Terms
Suggestion
Prevent delete non-optional property
Use Cases
Examples
foo.value = undefined
[ts] Type 'undefined' is not assignable to type 'number'. [2322]
the compiler reported error, everything is normal
delete foo.value;
The complier should be prevent this situation, it behaviors like the
foo.value = undefined
, but here complier reported not error.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: