0

I have a small typescript app which is composed of 4-5 typescript files. One of these files is called interfaces.ts and I use this to define internal data structures I'm using.

In many cases, the attributes in these interfaces are giving errors that they have "duplicate identifiers" which I'm sure isn't literally true as this is my own code and I have double checked that I didn't accidentally reproduce this. Also, it appears that those properties which have errors have references to the property but that shouldn't matter, right? Here's an example:

interface

And in this example, the id, fileStatus, and externalParties properties have more than one reference to them. See below for fileStatus:

fileStatus references

But I've also just noticed that the name property (which is without error) also has multiple references (so the reference theory may be a red herring):

name references

Any help on explaining this would make me feel a lot saner.

p.s. error or not the syntactic sugar and the transpilation to JS works without any issues

1 Answer 1

1

references to the property but that shouldn't matter, right

Indeed references don't matter. However you should actually trigger a goto definition to see all the places where it is defined.

WARNING: might be a vscode bug especially if your project has multiple tsconfig.json files.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah your suggestion makes perfect sense. Not sure why I didn't think of that but I went back to try and to my surprise the errors are now all gone. I haven't really made any substantial changes.
Hence vscode bug. I wrote my an IDE for TypeScript so all bugs would be my own alm.tools :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.