Issues with setting up typescript with Visual Studio Code












-1















Background



I'm new to the nodejs/typescript/VisualStudio Code and was trying to create a little project using express & sequelize-typescript.
I started the project with Visual Studio (NOT code) but had a lot of issues with false errors or no error showing up so I switched to Visual Studio Code.
I'm not sure anymore if Visual Studio (NOT code) installed nodejs by itself or/and if I installed an additional one. But I do know I have one npm in the PATH variable.



ts-nameof



Then in this project I needed to do a query to sequelize with an order by, so instead of hardcoding the column name or using the safetype string name (I hate string !) I found out ts-nameof.



So I follow the instruction :




  • npm i ttypescript -D

  • Add the plugins compilerOptions in tsconfig.json

  • Add the configuration "typescript.tsdk"


When things go nuts




  • ttypescript won't install because I didn't have typescript (uh?) so let install it : npm i typescript

  • Lets now use the nameof() method ! Hum Visual Studio Code tell me it can't find it. So I added



"node_modules/ts-nameof/ts-nameof.d.ts"




in the tsconfig.json "files" property. Yeah it works !




  • Not let's run the task "tsc: watch - tsconfig.json" - yeah it compile !



ReferenceError: nameof is not defined




but the runtime didn't like it...




  • When looking at the terminal it still use tsc instead of tscc, so from my understand I have to configure tasks.json so let's do it! Visual Studio did generate a basic file for me with the build/watch. I just added the command/type properties. (See the file at the end for reference)


Bonus for other users:





  • If you see the error



    The terminal process terminated with exit code: 2




it may be because you are using nodes_modules/npm/ttsc which is only for linux/osx (I don't know it it will work on windows 10 with the linux embedded thing)




  • Also installing ttypescript global may not be a good idea because it will install it in your user directory and you can't use %AppData% in the tasks.json, so you will have to hard the full path like C:UsersxcdcdcdcdAppDataRoaming...


Tasks against you




  • Let's compile it once by running the task "node_modules.binttsc.cmd" - Finally !


BTW: I had other issues with this file, see at the bottom in the note for tasks.json...




  • Now let add labels for each tasks - great now I can see both task instead of the only "node_modules.binttsc.cmd".
    What, it is using tsc now !?


Questions/Issues




  • While doing all this I tried to google my many issues without success. I'm a little worry about all issues I got, why I can't find anything? Ok maybe ttypescript isn't use by anybody, but all issues I have with the tasks.json...?


I had issue with googling typescript/nodejs with Visual Studio (not code) because everyone is using visual studio code... So there is definitivly something wrong on my side.




  • Maybe using something else than ts-nameof (which lead me to use ttypescript) is a better idea? If this isn't a good choice what would you recommend me.


  • I still have to figure out how to configure the "watch" task run AND how to have 2 tasks in tasks.json...


  • Keep reading for extra issues I have, like with "typescript.tsdk" or the "problemMatchers" options.



Files



.vscode/tasks.json:



{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"windows": {
"command": "node_modules\.bin\ttsc.cmd",
"type": "shell"
},
"tasks": [
{
//"label": "ttsc: watch",
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
]
},
{
//"label": "ttsc: build",
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
]
}
],
"problemMatchers": [
"$tsc"
]
}


Visual Studio Code seems to be off with this file, from the documentation I should be able to use command/type (and I think "windows") in a "tasks" object, which it doesn't let me go.



Also when running my task with this file Visual Studio Code is asking me for the problemMatcher and add this property at the root of tasks.json.



EDIT: I did also try to fill command/type properties everywhere (in the root, in all my tasks, and into the "windows" (in the root and in all my tasks as well).



.vscode/settings.json
(Workspace)



{
"files.exclude": {
"node_modules": true,

// visual studio project
"obj": true,
"bin": true
},

// ts-nameof
"typescript.tsdk": "node_modules/ttypescript/lib"
}


I did add the "typescript.tsdk" in the user settings as well just in case.
But I can write anything in this field it doesn't matter I never get any error.



tsconfig.json



{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": true,
"outDir": "dist",
"baseUrl": "./dist/",
"plugins": [{ "transform": "ts-nameof", "type": "raw" }],

// for sequelize-typescript models
"experimentalDecorators": true,
// for sequelize-typescript
"emitDecoratorMetadata": true
},
// Also part of experimentalDecorators
"include": [
"."
],
"exclude": [
"node_modules",

// VisualStudio project
"obj",
"bin"
],
"files": [ "node_modules/ts-nameof/ts-nameof.d.ts" ]
}









share|improve this question





























    -1















    Background



    I'm new to the nodejs/typescript/VisualStudio Code and was trying to create a little project using express & sequelize-typescript.
    I started the project with Visual Studio (NOT code) but had a lot of issues with false errors or no error showing up so I switched to Visual Studio Code.
    I'm not sure anymore if Visual Studio (NOT code) installed nodejs by itself or/and if I installed an additional one. But I do know I have one npm in the PATH variable.



    ts-nameof



    Then in this project I needed to do a query to sequelize with an order by, so instead of hardcoding the column name or using the safetype string name (I hate string !) I found out ts-nameof.



    So I follow the instruction :




    • npm i ttypescript -D

    • Add the plugins compilerOptions in tsconfig.json

    • Add the configuration "typescript.tsdk"


    When things go nuts




    • ttypescript won't install because I didn't have typescript (uh?) so let install it : npm i typescript

    • Lets now use the nameof() method ! Hum Visual Studio Code tell me it can't find it. So I added



    "node_modules/ts-nameof/ts-nameof.d.ts"




    in the tsconfig.json "files" property. Yeah it works !




    • Not let's run the task "tsc: watch - tsconfig.json" - yeah it compile !



    ReferenceError: nameof is not defined




    but the runtime didn't like it...




    • When looking at the terminal it still use tsc instead of tscc, so from my understand I have to configure tasks.json so let's do it! Visual Studio did generate a basic file for me with the build/watch. I just added the command/type properties. (See the file at the end for reference)


    Bonus for other users:





    • If you see the error



      The terminal process terminated with exit code: 2




    it may be because you are using nodes_modules/npm/ttsc which is only for linux/osx (I don't know it it will work on windows 10 with the linux embedded thing)




    • Also installing ttypescript global may not be a good idea because it will install it in your user directory and you can't use %AppData% in the tasks.json, so you will have to hard the full path like C:UsersxcdcdcdcdAppDataRoaming...


    Tasks against you




    • Let's compile it once by running the task "node_modules.binttsc.cmd" - Finally !


    BTW: I had other issues with this file, see at the bottom in the note for tasks.json...




    • Now let add labels for each tasks - great now I can see both task instead of the only "node_modules.binttsc.cmd".
      What, it is using tsc now !?


    Questions/Issues




    • While doing all this I tried to google my many issues without success. I'm a little worry about all issues I got, why I can't find anything? Ok maybe ttypescript isn't use by anybody, but all issues I have with the tasks.json...?


    I had issue with googling typescript/nodejs with Visual Studio (not code) because everyone is using visual studio code... So there is definitivly something wrong on my side.




    • Maybe using something else than ts-nameof (which lead me to use ttypescript) is a better idea? If this isn't a good choice what would you recommend me.


    • I still have to figure out how to configure the "watch" task run AND how to have 2 tasks in tasks.json...


    • Keep reading for extra issues I have, like with "typescript.tsdk" or the "problemMatchers" options.



    Files



    .vscode/tasks.json:



    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "windows": {
    "command": "node_modules\.bin\ttsc.cmd",
    "type": "shell"
    },
    "tasks": [
    {
    //"label": "ttsc: watch",
    "type": "typescript",
    "tsconfig": "tsconfig.json",
    "option": "watch",
    "problemMatcher": [
    "$tsc-watch"
    ]
    },
    {
    //"label": "ttsc: build",
    "type": "typescript",
    "tsconfig": "tsconfig.json",
    "problemMatcher": [
    "$tsc"
    ]
    }
    ],
    "problemMatchers": [
    "$tsc"
    ]
    }


    Visual Studio Code seems to be off with this file, from the documentation I should be able to use command/type (and I think "windows") in a "tasks" object, which it doesn't let me go.



    Also when running my task with this file Visual Studio Code is asking me for the problemMatcher and add this property at the root of tasks.json.



    EDIT: I did also try to fill command/type properties everywhere (in the root, in all my tasks, and into the "windows" (in the root and in all my tasks as well).



    .vscode/settings.json
    (Workspace)



    {
    "files.exclude": {
    "node_modules": true,

    // visual studio project
    "obj": true,
    "bin": true
    },

    // ts-nameof
    "typescript.tsdk": "node_modules/ttypescript/lib"
    }


    I did add the "typescript.tsdk" in the user settings as well just in case.
    But I can write anything in this field it doesn't matter I never get any error.



    tsconfig.json



    {
    "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "sourceMap": true,
    "noImplicitAny": true,
    "outDir": "dist",
    "baseUrl": "./dist/",
    "plugins": [{ "transform": "ts-nameof", "type": "raw" }],

    // for sequelize-typescript models
    "experimentalDecorators": true,
    // for sequelize-typescript
    "emitDecoratorMetadata": true
    },
    // Also part of experimentalDecorators
    "include": [
    "."
    ],
    "exclude": [
    "node_modules",

    // VisualStudio project
    "obj",
    "bin"
    ],
    "files": [ "node_modules/ts-nameof/ts-nameof.d.ts" ]
    }









    share|improve this question



























      -1












      -1








      -1








      Background



      I'm new to the nodejs/typescript/VisualStudio Code and was trying to create a little project using express & sequelize-typescript.
      I started the project with Visual Studio (NOT code) but had a lot of issues with false errors or no error showing up so I switched to Visual Studio Code.
      I'm not sure anymore if Visual Studio (NOT code) installed nodejs by itself or/and if I installed an additional one. But I do know I have one npm in the PATH variable.



      ts-nameof



      Then in this project I needed to do a query to sequelize with an order by, so instead of hardcoding the column name or using the safetype string name (I hate string !) I found out ts-nameof.



      So I follow the instruction :




      • npm i ttypescript -D

      • Add the plugins compilerOptions in tsconfig.json

      • Add the configuration "typescript.tsdk"


      When things go nuts




      • ttypescript won't install because I didn't have typescript (uh?) so let install it : npm i typescript

      • Lets now use the nameof() method ! Hum Visual Studio Code tell me it can't find it. So I added



      "node_modules/ts-nameof/ts-nameof.d.ts"




      in the tsconfig.json "files" property. Yeah it works !




      • Not let's run the task "tsc: watch - tsconfig.json" - yeah it compile !



      ReferenceError: nameof is not defined




      but the runtime didn't like it...




      • When looking at the terminal it still use tsc instead of tscc, so from my understand I have to configure tasks.json so let's do it! Visual Studio did generate a basic file for me with the build/watch. I just added the command/type properties. (See the file at the end for reference)


      Bonus for other users:





      • If you see the error



        The terminal process terminated with exit code: 2




      it may be because you are using nodes_modules/npm/ttsc which is only for linux/osx (I don't know it it will work on windows 10 with the linux embedded thing)




      • Also installing ttypescript global may not be a good idea because it will install it in your user directory and you can't use %AppData% in the tasks.json, so you will have to hard the full path like C:UsersxcdcdcdcdAppDataRoaming...


      Tasks against you




      • Let's compile it once by running the task "node_modules.binttsc.cmd" - Finally !


      BTW: I had other issues with this file, see at the bottom in the note for tasks.json...




      • Now let add labels for each tasks - great now I can see both task instead of the only "node_modules.binttsc.cmd".
        What, it is using tsc now !?


      Questions/Issues




      • While doing all this I tried to google my many issues without success. I'm a little worry about all issues I got, why I can't find anything? Ok maybe ttypescript isn't use by anybody, but all issues I have with the tasks.json...?


      I had issue with googling typescript/nodejs with Visual Studio (not code) because everyone is using visual studio code... So there is definitivly something wrong on my side.




      • Maybe using something else than ts-nameof (which lead me to use ttypescript) is a better idea? If this isn't a good choice what would you recommend me.


      • I still have to figure out how to configure the "watch" task run AND how to have 2 tasks in tasks.json...


      • Keep reading for extra issues I have, like with "typescript.tsdk" or the "problemMatchers" options.



      Files



      .vscode/tasks.json:



      {
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "windows": {
      "command": "node_modules\.bin\ttsc.cmd",
      "type": "shell"
      },
      "tasks": [
      {
      //"label": "ttsc: watch",
      "type": "typescript",
      "tsconfig": "tsconfig.json",
      "option": "watch",
      "problemMatcher": [
      "$tsc-watch"
      ]
      },
      {
      //"label": "ttsc: build",
      "type": "typescript",
      "tsconfig": "tsconfig.json",
      "problemMatcher": [
      "$tsc"
      ]
      }
      ],
      "problemMatchers": [
      "$tsc"
      ]
      }


      Visual Studio Code seems to be off with this file, from the documentation I should be able to use command/type (and I think "windows") in a "tasks" object, which it doesn't let me go.



      Also when running my task with this file Visual Studio Code is asking me for the problemMatcher and add this property at the root of tasks.json.



      EDIT: I did also try to fill command/type properties everywhere (in the root, in all my tasks, and into the "windows" (in the root and in all my tasks as well).



      .vscode/settings.json
      (Workspace)



      {
      "files.exclude": {
      "node_modules": true,

      // visual studio project
      "obj": true,
      "bin": true
      },

      // ts-nameof
      "typescript.tsdk": "node_modules/ttypescript/lib"
      }


      I did add the "typescript.tsdk" in the user settings as well just in case.
      But I can write anything in this field it doesn't matter I never get any error.



      tsconfig.json



      {
      "compilerOptions": {
      "target": "esnext",
      "module": "commonjs",
      "sourceMap": true,
      "noImplicitAny": true,
      "outDir": "dist",
      "baseUrl": "./dist/",
      "plugins": [{ "transform": "ts-nameof", "type": "raw" }],

      // for sequelize-typescript models
      "experimentalDecorators": true,
      // for sequelize-typescript
      "emitDecoratorMetadata": true
      },
      // Also part of experimentalDecorators
      "include": [
      "."
      ],
      "exclude": [
      "node_modules",

      // VisualStudio project
      "obj",
      "bin"
      ],
      "files": [ "node_modules/ts-nameof/ts-nameof.d.ts" ]
      }









      share|improve this question
















      Background



      I'm new to the nodejs/typescript/VisualStudio Code and was trying to create a little project using express & sequelize-typescript.
      I started the project with Visual Studio (NOT code) but had a lot of issues with false errors or no error showing up so I switched to Visual Studio Code.
      I'm not sure anymore if Visual Studio (NOT code) installed nodejs by itself or/and if I installed an additional one. But I do know I have one npm in the PATH variable.



      ts-nameof



      Then in this project I needed to do a query to sequelize with an order by, so instead of hardcoding the column name or using the safetype string name (I hate string !) I found out ts-nameof.



      So I follow the instruction :




      • npm i ttypescript -D

      • Add the plugins compilerOptions in tsconfig.json

      • Add the configuration "typescript.tsdk"


      When things go nuts




      • ttypescript won't install because I didn't have typescript (uh?) so let install it : npm i typescript

      • Lets now use the nameof() method ! Hum Visual Studio Code tell me it can't find it. So I added



      "node_modules/ts-nameof/ts-nameof.d.ts"




      in the tsconfig.json "files" property. Yeah it works !




      • Not let's run the task "tsc: watch - tsconfig.json" - yeah it compile !



      ReferenceError: nameof is not defined




      but the runtime didn't like it...




      • When looking at the terminal it still use tsc instead of tscc, so from my understand I have to configure tasks.json so let's do it! Visual Studio did generate a basic file for me with the build/watch. I just added the command/type properties. (See the file at the end for reference)


      Bonus for other users:





      • If you see the error



        The terminal process terminated with exit code: 2




      it may be because you are using nodes_modules/npm/ttsc which is only for linux/osx (I don't know it it will work on windows 10 with the linux embedded thing)




      • Also installing ttypescript global may not be a good idea because it will install it in your user directory and you can't use %AppData% in the tasks.json, so you will have to hard the full path like C:UsersxcdcdcdcdAppDataRoaming...


      Tasks against you




      • Let's compile it once by running the task "node_modules.binttsc.cmd" - Finally !


      BTW: I had other issues with this file, see at the bottom in the note for tasks.json...




      • Now let add labels for each tasks - great now I can see both task instead of the only "node_modules.binttsc.cmd".
        What, it is using tsc now !?


      Questions/Issues




      • While doing all this I tried to google my many issues without success. I'm a little worry about all issues I got, why I can't find anything? Ok maybe ttypescript isn't use by anybody, but all issues I have with the tasks.json...?


      I had issue with googling typescript/nodejs with Visual Studio (not code) because everyone is using visual studio code... So there is definitivly something wrong on my side.




      • Maybe using something else than ts-nameof (which lead me to use ttypescript) is a better idea? If this isn't a good choice what would you recommend me.


      • I still have to figure out how to configure the "watch" task run AND how to have 2 tasks in tasks.json...


      • Keep reading for extra issues I have, like with "typescript.tsdk" or the "problemMatchers" options.



      Files



      .vscode/tasks.json:



      {
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "windows": {
      "command": "node_modules\.bin\ttsc.cmd",
      "type": "shell"
      },
      "tasks": [
      {
      //"label": "ttsc: watch",
      "type": "typescript",
      "tsconfig": "tsconfig.json",
      "option": "watch",
      "problemMatcher": [
      "$tsc-watch"
      ]
      },
      {
      //"label": "ttsc: build",
      "type": "typescript",
      "tsconfig": "tsconfig.json",
      "problemMatcher": [
      "$tsc"
      ]
      }
      ],
      "problemMatchers": [
      "$tsc"
      ]
      }


      Visual Studio Code seems to be off with this file, from the documentation I should be able to use command/type (and I think "windows") in a "tasks" object, which it doesn't let me go.



      Also when running my task with this file Visual Studio Code is asking me for the problemMatcher and add this property at the root of tasks.json.



      EDIT: I did also try to fill command/type properties everywhere (in the root, in all my tasks, and into the "windows" (in the root and in all my tasks as well).



      .vscode/settings.json
      (Workspace)



      {
      "files.exclude": {
      "node_modules": true,

      // visual studio project
      "obj": true,
      "bin": true
      },

      // ts-nameof
      "typescript.tsdk": "node_modules/ttypescript/lib"
      }


      I did add the "typescript.tsdk" in the user settings as well just in case.
      But I can write anything in this field it doesn't matter I never get any error.



      tsconfig.json



      {
      "compilerOptions": {
      "target": "esnext",
      "module": "commonjs",
      "sourceMap": true,
      "noImplicitAny": true,
      "outDir": "dist",
      "baseUrl": "./dist/",
      "plugins": [{ "transform": "ts-nameof", "type": "raw" }],

      // for sequelize-typescript models
      "experimentalDecorators": true,
      // for sequelize-typescript
      "emitDecoratorMetadata": true
      },
      // Also part of experimentalDecorators
      "include": [
      "."
      ],
      "exclude": [
      "node_modules",

      // VisualStudio project
      "obj",
      "bin"
      ],
      "files": [ "node_modules/ts-nameof/ts-nameof.d.ts" ]
      }






      typescript visual-studio-code vscode-settings






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 27 '18 at 13:06









      Gama11

      11.8k52349




      11.8k52349










      asked Nov 25 '18 at 21:08









      0xCDCDCDCD0xCDCDCDCD

      8911




      8911
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I still have no clue of what going on but the tasks.json syntax I read about seem to be the basic one and languages extend it hence why type could by typescript and contains a property like tsconfig. Unfortunately I didn't find the syntax for typescript.



          I end up creating the shell tasks like so :



          {
          // See https://go.microsoft.com/fwlink/?LinkId=733558
          // for the documentation about the tasks.json format
          "version": "2.0.0",
          "tasks": [
          {
          "label": "ttsc: watch",
          "type": "shell",
          "windows": {
          "command": "node_modules\.bin\ttsc.cmd",
          "args": [
          "--watch", "-p", "tsconfig.json"
          ],
          },
          "problemMatcher": [
          "$tsc-watch"
          ]
          },
          {
          "label": "ttsc: build",
          "type": "shell",
          "windows": {
          "command": "node_modules\.bin\ttsc.cmd",
          "args": [
          "-p", "tsconfig.json"
          ],
          },
          "problemMatcher": [
          "$tsc"
          ]
          }
          ]
          }





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472006%2fissues-with-setting-up-typescript-with-visual-studio-code%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I still have no clue of what going on but the tasks.json syntax I read about seem to be the basic one and languages extend it hence why type could by typescript and contains a property like tsconfig. Unfortunately I didn't find the syntax for typescript.



            I end up creating the shell tasks like so :



            {
            // See https://go.microsoft.com/fwlink/?LinkId=733558
            // for the documentation about the tasks.json format
            "version": "2.0.0",
            "tasks": [
            {
            "label": "ttsc: watch",
            "type": "shell",
            "windows": {
            "command": "node_modules\.bin\ttsc.cmd",
            "args": [
            "--watch", "-p", "tsconfig.json"
            ],
            },
            "problemMatcher": [
            "$tsc-watch"
            ]
            },
            {
            "label": "ttsc: build",
            "type": "shell",
            "windows": {
            "command": "node_modules\.bin\ttsc.cmd",
            "args": [
            "-p", "tsconfig.json"
            ],
            },
            "problemMatcher": [
            "$tsc"
            ]
            }
            ]
            }





            share|improve this answer




























              0














              I still have no clue of what going on but the tasks.json syntax I read about seem to be the basic one and languages extend it hence why type could by typescript and contains a property like tsconfig. Unfortunately I didn't find the syntax for typescript.



              I end up creating the shell tasks like so :



              {
              // See https://go.microsoft.com/fwlink/?LinkId=733558
              // for the documentation about the tasks.json format
              "version": "2.0.0",
              "tasks": [
              {
              "label": "ttsc: watch",
              "type": "shell",
              "windows": {
              "command": "node_modules\.bin\ttsc.cmd",
              "args": [
              "--watch", "-p", "tsconfig.json"
              ],
              },
              "problemMatcher": [
              "$tsc-watch"
              ]
              },
              {
              "label": "ttsc: build",
              "type": "shell",
              "windows": {
              "command": "node_modules\.bin\ttsc.cmd",
              "args": [
              "-p", "tsconfig.json"
              ],
              },
              "problemMatcher": [
              "$tsc"
              ]
              }
              ]
              }





              share|improve this answer


























                0












                0








                0







                I still have no clue of what going on but the tasks.json syntax I read about seem to be the basic one and languages extend it hence why type could by typescript and contains a property like tsconfig. Unfortunately I didn't find the syntax for typescript.



                I end up creating the shell tasks like so :



                {
                // See https://go.microsoft.com/fwlink/?LinkId=733558
                // for the documentation about the tasks.json format
                "version": "2.0.0",
                "tasks": [
                {
                "label": "ttsc: watch",
                "type": "shell",
                "windows": {
                "command": "node_modules\.bin\ttsc.cmd",
                "args": [
                "--watch", "-p", "tsconfig.json"
                ],
                },
                "problemMatcher": [
                "$tsc-watch"
                ]
                },
                {
                "label": "ttsc: build",
                "type": "shell",
                "windows": {
                "command": "node_modules\.bin\ttsc.cmd",
                "args": [
                "-p", "tsconfig.json"
                ],
                },
                "problemMatcher": [
                "$tsc"
                ]
                }
                ]
                }





                share|improve this answer













                I still have no clue of what going on but the tasks.json syntax I read about seem to be the basic one and languages extend it hence why type could by typescript and contains a property like tsconfig. Unfortunately I didn't find the syntax for typescript.



                I end up creating the shell tasks like so :



                {
                // See https://go.microsoft.com/fwlink/?LinkId=733558
                // for the documentation about the tasks.json format
                "version": "2.0.0",
                "tasks": [
                {
                "label": "ttsc: watch",
                "type": "shell",
                "windows": {
                "command": "node_modules\.bin\ttsc.cmd",
                "args": [
                "--watch", "-p", "tsconfig.json"
                ],
                },
                "problemMatcher": [
                "$tsc-watch"
                ]
                },
                {
                "label": "ttsc: build",
                "type": "shell",
                "windows": {
                "command": "node_modules\.bin\ttsc.cmd",
                "args": [
                "-p", "tsconfig.json"
                ],
                },
                "problemMatcher": [
                "$tsc"
                ]
                }
                ]
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 29 '18 at 1:46









                0xCDCDCDCD0xCDCDCDCD

                8911




                8911
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472006%2fissues-with-setting-up-typescript-with-visual-studio-code%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python