Simplify SvelteKit Import and Path Usage
This codemod simplifies the import statements and path resolution in your SvelteKit project. It replaces the usage of resolvePath and concatenation with base by using the resolveRoute function from $app/paths. This results in cleaner and more readable code.
Transformations
This codemod performs the following transformations:
-
Import Statement: Transforms:
typescriptinto
typescript -
Path Resolution: Transforms:
typescriptinto
typescript
Usage
To apply this codemod, run the workflow script on your TypeScript files. Ensure you have the necessary dependencies installed and your project is configured to use this codemod.
Example
Before
typescript
After
typescript