Jasmine syntax and methods not recognized

PHPStorm 2016.1

According to this solution I downloaded TypeScript community stubs for jasmine (and karma-jasmine), but in my app the jasmine syntax is still red, which means it's not recognized. What else can be done to enable syntax highlighting, autocomplete etc for Jasmine in PHPStorm?

 

3 comments

In your case errors come from Typescript compiler. External libraries configured in Settings/Languages & Frameworks/JavaScript/Libraries are NOT available to typescript compiler, they are only used by the built-in parser for code completion/navigation/etc. You need to have all files involved in compilation right in your project, and make sure to either include them in your tsconfig.json or provide proper ///<reference path> comments.

0

Thanks for the suggestions. I did as recommended in this post and added file jasmine.d.ts to my project from here and it seems to be ok now with the compiler.

0

Please sign in to leave a comment.