79466651

Date: 2025-02-25 13:06:32
Score: 1
Natty:
Report link

The user is viewing the file in node_modules but their tsconfig is set not to apply to the files in that folder. Therefore VSCode has linted it with default settings.

This was made clear in the discussion in the GitHub issue linked in the question:

This is working as intended. The #private is added to make the class nominally typed (instead of structurally typed). The created declaration file is also valid when you target ECMAScript 2015 or higher.

But then why does TS complain about it?

Because you open the file in a context without a tsconfig.json file, or where the tsconfig.json has a target lower than ECMAScript 2015. The default is ECMAScript 5, which does not support private fields.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: aantia