Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to detect import from alias paths using ts-morph? #1338

Open
jon9090 opened this issue Oct 8, 2022 · 1 comment
Open

Is it possible to detect import from alias paths using ts-morph? #1338

jon9090 opened this issue Oct 8, 2022 · 1 comment

Comments

@jon9090
Copy link

jon9090 commented Oct 8, 2022

I set the path alias in my tsconfig.json:

 paths: {
  "module/*": ["./src/app/module/*"],
  ...
 }

and I have import like this:

import { foo } from '@module/foo';

Is it possible to know if the import is from alias paths?

@alexpineda
Copy link

Compare the string to the paths array in your tsconfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants