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
Let's consider next code where we omit inexistent key from interface Todo :
Todo
interface Todo { title: string; description: string; completed: boolean; } type TodoPreview = Omit<Todo, 'not_existed_key'>; // currently error is not thrown
Let's imagine that previously interface Todo had property not_existed_key and we had variable such as
not_existed_key
const todoItem: TodoPreview = {...}
but then not_existed_key was removed and developer forgot to remove TodoPreview because it became redundant.
TodoPreview
From my point of view will be better to have more strictly behavior of Omit.
Omit
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
See discussion at #30825
Sorry, something went wrong.
Thanks @RyanCavanaugh !
No branches or pull requests
Search Terms
Omit inexistent keySuggestion
Let's consider next code where we omit inexistent key from interface
Todo
:Use Cases
Let's imagine that previously interface
Todo
had propertynot_existed_key
and we had variable such asbut then
not_existed_key
was removed and developer forgot to removeTodoPreview
because it became redundant.Examples
From my point of view will be better to have more strictly behavior of
Omit
.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: