Duplicate test names linter rule - Colour Issue



Looking at the same feature of portraying a duplicate function to a user in different projects. I was able to identify a variation in the colour of the linter rule.

Below image shows a Java project indicating a duplicate function. (Notice the linter rule is RED)

In this image, we have typescript project indicating a duplicate function: (Notice the linter rule is GREEN)



Hey @maleeshpiyaratne,

this might look like an inconsistency at first, but there is a good reason for this:
In Java, each individual test is represented by a method. Having two methods of the same name within a Java class results in a compile error. Therefore, the squiggles are red.

In TypeScript, tests are defined by function calls, instead of functions. Therefore, there are no build errors here, and a linter rule is in place to prevent duplicates instead. Lint errors are shown in green.

Hope this explains it well enough.


Thank you @matthias for clarifying this grey area
Your explanation is clear and understandable.

closed #4