6

I am working on a large TypeScript application in VS 2013. I have ReSharper and WebEssentials installed.

Time to time when I have an exported module level function, "something" underlines it and hints that "Class emulation may be converted to class". What does this mean, and from which tool it comes from?

Did anyone see this before? Surprisingly there are no Google results for this sentence in quotes.

Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93
  • I also want to know what this means. I have a typescript module with a couple of exported function. Only 1 of these functions get an underline with this hint and I have no idea why. The only google result is this unanswered question :) – Remko Jansen Feb 22 '16 at 08:03

1 Answers1

9

It must look like an emulated class... ReSharper may be guessing you hard coded your own class in Typescript, rather than defining it and letting the compiler create the JS.

Adding a return type of void removes the warning...

Daryl
  • 18,592
  • 9
  • 78
  • 145
  • 2
    Yes it seems like the warning comes when I use the this keyword inside a module level function. Thank you for the explicit void tip. – Zoltán Tamási Jul 13 '16 at 18:35