Mikaël Mayer
Mikaël Mayer

Reputation: 10711

Typescript/Resharper 9. Duplicate identifier

I get a lot of "Duplicate identifier" errors in Visual Studio 2013 which make my code unreadable since I installed Resharper 9.

Duplicate identifier

The only reason I can see that there are duplicate errors, is that in another project, these files are included and thus compiled another time. But it should not interfere. Even when I unload the "dependent" project, I still get these annoying highlighting errors. IPosition is not only the only one affected, ILabel, ILabelExample, etc. all got the same error on all fields.

These errors are highlighted in the code, but not in the error list - and compilation is fine.

Related questions:

What setting should I change to make them disappear? Thank you for helping.

Upvotes: 11

Views: 2066

Answers (3)

VitalickS
VitalickS

Reputation: 59

Try checking the bin folder. It can contain .ts files and it generates duplication. You need to add the bin folder to the exclusion list. Something like this:

....
"exclude": [
    "node_modules",
    "wwwroot/lib",
    "bin"
  ]
....

Upvotes: 1

Doug Domeny
Doug Domeny

Reputation: 4470

This is fixed in ReSharper 2016.2.

Upvotes: 2

Louay Alakkad
Louay Alakkad

Reputation: 7408

You have the part export interface IPosition in two files. You should get two identical errors in two different files.

Just add one of those files (or folders) to tsconfig.json to the "ignore" key.

Upvotes: 0

Related Questions