Affects Version/s: None
Fix Version/s: None
We observe different results when a file is analyzed either in a dedicated project or in an attached project.
Example with 2 separate TS projects, app1 and app2.
Scenario 1: open app2 as a project and analyze a subfile:
> baseDir: C:\sonarlint-test\app2
> Found 1 tsconfig.json file(s): [C:\sonarlint-test\app2\tsconfig.json]
C:/sonarlint-test/app2/src/app/test.component.ts matched C:\sonarlint-test\app2\tsconfig.json
Scenario 2: open app1 as a project, attach app2 and analyze the same subfile:
> baseDir: C:\sonarlint-test\app1
> Found 1 tsconfig.json file(s): [C:\sonarlint-test\app-1\tsconfig.json]
C:/sonarlint-test/app-2/src/app/test.component.ts matched NO_CONFIG
For the base dir we use the folder of the first opened project. We wrongly detect the tsconfig.json file of the first opened project (app1) instead of the attached one (app2), and the file that we try to analyze is excluded by the TS analyzer.
The concept of base dir does not make sense in this context. In IntelliJ, source files of a module are contained in "source roots", and modules can have several ones, so in theory we could have several base dirs. It might be better to not rely on the base dir to locate the tsconfig file.