ReSharper TypeScript definition files (using lib.d.ts instead of lib.es5.d.ts)

I have a project with typescript files.  The project is targeting TypeScript 3.1 and ECMAScript 5.  When calling Object's hasOwnProperty, Visual Studio sees that this method can take a string, number, or symbol, and thus does not shown any errors when passing a number to this method.  On my machine, ReSharper does not flag this as an error (as it shouldn't), and peeking at the definition for Object.hasOwnProperty, it is pulling the definition from C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.5\lib.es5.d.ts.

Opening the same project on another developers machine, highlights this call with an error.  There, Visual Studio says it takes a string, number, or symbol still, but when I peek definition, the definition that is displayed says the method only takes a string, and the definition comes from the file C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\lib.d.ts and thus ReSharper is showing it as an error.

My system has 2.6, 2.8, 3.0, 3.1, and 3.5 SDKs, the incorrectly behaving system has 2.5, 2.6, 3.0, 3.1, and 3.5 SDKs.  Both systems are Windows 10, and Visual Studio 2019 16.2.0.

 

I have renamed the 2.5 folder to try to force ReSharper to search for other definition files, I have uninstalled and reinstalled ReSharper, I have cleared the ReSharper cache folders, change both the TypeScript version and ECMSScript version and then back, none of these have forced ReSharper to start looking at the 3.5 SDK folder.

 

 

How do I get ReSharper to use the TypeScript 3.5 SDK defintion files?

0
1 comment
Avatar
Permanently deleted user

In the end I managed to get it 'work" by uninstalling the 2.5 SDK and clearing ReSharper's cache.  At that point it finally pulled from the 3.5 SDK's lib.es5.d.ts file.

0

Please sign in to leave a comment.