Typescript guide gives “Duplicate function implementation” warning

后端 未结 6 1688
小蘑菇
小蘑菇 2020-12-30 20:44

I\'m getting started with TypeScript and at moment I\'m following the TypeScript in 5 minutes guide. I\'m receiving a strange warning in Visual Studio Code when I hover the

6条回答
  •  难免孤独
    2020-12-30 21:33

    If you have both the src file (typescript) and the transpiled file (javascript) in the same directory and open up the javascript file in VS Code then you'll get the error. Output the transpiled file into a directory and it will not error. Use the --outDir flag: tsc --outDir ./dist greeter.ts

    Got this problem in version 1.26.1 of VS Code. Generating the tsconfig.json file did not make the error go away for me.

提交回复
热议问题