I am trying to rewrite all existing relative paths in my javascript/typescript project to absolute paths.
Example:
import example from "../../example"
would be rewritten to
import example from "src/components/example"
So I am looking for a script or similar to transform all these imports. Preferably it would be possible to run this as an npm script on precommit or similar.
Is there a way to do this?