Quantcast
Channel: Environment – MunchPress
Viewing all articles
Browse latest Browse all 8

‘Property Declarations’ can only be used in a .ts file (Visual Studio Code)

$
0
0

Visual Studio Code is fast lightweight code editor, but there’s one problem that totally bugs me.

vsc-propdeclarationbug

'Property Declarations' can only be used in a .ts file (Visual Studio Code)

This generates a bunch of malformed errors in syntax detection in the image shown below. If you are facing this issue in Visual Studio Code (v1.5.2), it is because of TS1.8.1.

Here’s how to solve it:

  • Install typescript into your project workspace

npm install typescript@next --save-dev

  • Select “Preferences > Workspace Settings” in Visual Studio Code.

{
   "typescript.tsdk": "node_modules/typescript/lib"
}

  • Restart Visual Studio Code.

Done.

The post ‘Property Declarations’ can only be used in a .ts file (Visual Studio Code) appeared first on MunchPress.


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images