If you work on a decently sized TypeScript application, chances are that your source directories are nested quite a bit and you will have various components which need to import something from completely different folders. So if you find yourself writing a lot of imports with ../../../
, then this tip might be helpful for you!
A useful tool in that case are import aliases. If you are using webpack these are part of the Module Resolution. Justin Tulk wrote a great post about import aliasing with webpack, VS Code and Jest, so be sure to check that one out!