ERROR: File can't be indexed twice

Hi I have encountered this error already mentioned in other posts, but still I can’t find a solution.

ERROR: File src/tests/app.controller.spec.ts can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

And this is my sonar.properties:

sonar.sources=./src
sonar.exclusions=src/tests
sonar.tests=src/tests
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.typescript.tsconfigPath=tsconfig.json
sonar.coverage.exclusions=src/main.ts,src/tests/**
sonar.verbose=true

The test folder must remain inside src, basically the frameqork itself creates the test files inside src, I just grouped them together.
Now I can’t tell it not to consider them 2 times

How can I solve it?

Hey there.

As mentioned in the template post, what version of SonarQube are you using?