Everlaw / nbts

NetBeans TypeScript editor plugin
283 stars 46 forks source link

Global @types functions not being recognized #131

Open nick-pww opened 6 years ago

nick-pww commented 6 years ago

Just upgrade to 2.5.3 from 2.1.X and am having issues where functions like "require('...')" from node and "describe('...')" from Jasmine are being flagged with 'Cannot find name'. These worked fine in the older versions.

I've tried removing the NetBeans cache as well as updating those particular dependencies.

It seems like if I add import statements for these specifically it stops complaining:

import 'jasmine';
import 'node';

But then I when I actually compile (using webpack) it complains about not finding the node module. With out these changes everything compiles fine.

qbixus commented 6 years ago

I have the same issue. Possible workaround is to put /// into root custom.d.ts - at least, it works in my case.

majalette commented 6 years ago

I had the same problem with version 2.5.3.0 I managed to fix it by adding "typeRoots" : ["./node_modules/@types"] to compilerOptions in tsconfig.json and restarting netbeans.

Hope this helps