In VSCode, I am working with TypeScript and experiencing an issue when I compile to JavaScript whereby the IDE will complain that certain elements - classes, variables etc. - are duplicates. This is because they exist in the TypeScript file and the JavaScript file that is created as a result.
I imagine this is a fairly common problem, but to clarify a couple of things:
- This does not appear to prevent TypeScript compilation
- This only occurs when the .js file is open in the IDE (VSCode)
Below is an image showing what I mean:
I am not very experienced in working with npm or the command line, so I'm not sure if I've inadvertently enabled this behaviour or missed something out - it is clearly undesirable though, so I was wondering if anyone can think what might be causing the problem? For a start, is this more likely to be a VSCode problem or a TypeScript problem?
I have looked at a few similar questions on SO - e.g. this, but none seem to be experiencing the exact same issue as me.
Many thanks!