3 Replies Last post: Mar 21, 2013 9:12 PM by brad n  
brad n Newbie 3 posts since
Mar 21, 2013
Currently Being Moderated

Mar 21, 2013 2:01 AM

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

Konstantin Ulitin JetBrains 81 posts since
Jan 19, 2012
Currently Being Moderated
Mar 21, 2013 8:27 PM in response to: brad n
Re: Typescript - module import paths + code hints

Hi Brad,

We actually have some problems with TypeScript reference paths and import statements, but in progress of fixing them, including absolute paths. Please watch WEB-2033 to get notification when it is fixed.

 

Best regards,

Konstantin

More Like This

  • Retrieving data ...