Typescript guide gives "Duplicate function implementation" warning
Looks like this is a bug in Visual Studio Code. There are a few issues on GitHub about this, such as here and here. The comments on the issues imply that it was an issue, then was fixed, and has just become an issue again in v1.12.1.
It looks as if the solution is to run tsc --init
to initialize the tsconfig.json
in the folder.
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.
When we open both file.ts and the transpiled file.js files and do TSC, this error occurs.
Please close the transpiled file.js and try again.