TypeScript allows editors to perform automated refactors which are aware of the rules of the languages.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/624c3f6a-0368-4d99-8382-ebc74d3836cb/Untitled.png

Here, for instance, Visual Studio Code is able to rename references to the inner foo without altering the outer foo. This would be difficult to do with a simple find/replace.