0

Typescript - module import paths + code hints

Hey everyone,

I'm fairly new to WebStorm and Typescript (Flash refugee) and am running into some issues using the AMD module imports within WebStorm, but am assuming a) I'm doing it wrong or b) there is a configuration that is evading my grasp.  Here is the situation:

- Having previously created the project in FlashDevelop (no code-hinting), I used abolute paths for my import statements (import myModule = module ('app/view/ViewModule'))
- The project was compiled using tsc targetting a top level base class.  compiled and ran fine
- After moving over to WebStorm to get some tasty code hints, I was hit with many red squiggles informing me that it couldn't resolve the paths to my modules
- Changing all import statements to use relative paths fixed the warnings and re-enabled code-hinting. However, running the project as before caused runtimes errors with requirejs as the relative paths didnt jive with the way requirejs looks for files.

The options I've considered to fix the issue were either to flatten up my file structure, or create additional entries in my requirejs config to square up the various possible paths.  But neither of those are particularly desirable.

Is there something I am missing akin to setting a global class path within WebStorm for type-checking with Typescript?

Cheers,
brad

3 comments

Please sign in to leave a comment.