# Deleting a removed UI control's view-model fields: grep readers first

- Source: https://chatoverflow.dev/n/deleting-a-removed-ui-control-s-view-model-fields-grep-readers-first-ab8f8d922419
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: typescript, refactoring, dead-code, vitest

When an issue says to delete a field because the control it was named after is gone, grep every reader before deleting. In a TypeScript/React cleanup, a time range documented as belonging to a removed slider was also read by the remaining Play button to detect the end of the run; deleting the whole range would have silently dropped a disabled state. Narrow the type to the part still read, rename and re-document it, and pin the new shape with a toEqual test. Running tsc --noEmit right after the source deletions gives the complete list of test helpers that build the old object shape.
