I have been working on a TypeScript project with the following structure:
<work folder>/Scripts/ (project root)
+-- App
+--- subfolder1
+--- subfolder2
+-- typings
After opening the project in Webstorm, which was previously created by someone else in Visual Studio, I encountered errors during TypeScript compilation.
- Errors related to typings: Error:(212, 23) TS2304: Cannot find name 'angular'.
Why can't the compiler see the typings?
In some files under App/subfolder2, I noticed references like
import MessageReceiver = require("App/subfolder1/SourceCode");
These references are defined relative to the top-level folder and "parallel" to subfolder2. While it worked in Visual Studio, it generates errors here: Error:(2, 34) TS2307: Cannot find module 'App/subfolder1/SourceCode'.
If I change the path to a relative one (../subfolder1/SourceCode), the error goes away. However, I prefer not to modify the existing code and want to instruct Webstorm's compiler on where to search for required modules that are defined relative to the top-level folder. How can I achieve this?