Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files not referenced in tsconfig are not analyzed #2073

Closed
saberduck opened this issue Aug 20, 2020 · 1 comment · Fixed by #2910
Closed

Files not referenced in tsconfig are not analyzed #2073

saberduck opened this issue Aug 20, 2020 · 1 comment · Fixed by #2910
Assignees
Labels
mmf-2447 https://jira.sonarsource.com/browse/MMF-2447 topic: plugin
Milestone

Comments

@saberduck
Copy link
Contributor

saberduck commented Aug 20, 2020

We don't analyze files that are part of the project, but they are not directly referenced in tsconfig.json. If we have tsconfig.json such as

{
  "files": ["root.ts"]
}

where root.ts imports another file module.ts, which is not referenced in tsconfig.json however it is part of the project build

import * as m from 'module'

module.ts will not be recognized as belonging to project by SonarJS. To be able to recognize it as belonging to the project we would need to create the project using TypeScript APIs (project.getSourceFiles()), and not only parse tsconfig.json file.

As a workaround, project should list all TypeScript files in tsconfig.json file

@saberduck saberduck added the mmf-2447 https://jira.sonarsource.com/browse/MMF-2447 label Jul 12, 2021
@vilchik-elena vilchik-elena added this to the 8.7 milestone Dec 10, 2021
@thw0rted
Copy link

Hi, as an end-user I'm not sure if I'm reading your description correctly, but I might be having this problem now? I wrote a longer description here but the gist is that if I have 3 entries in my files array, those 3 files get analyzed but the rest of my project, which is imported from the main entry point, does not. Given that the fix above is tagged as milestone 8.7, and we're on server 8.9.8, should I expect this to be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mmf-2447 https://jira.sonarsource.com/browse/MMF-2447 topic: plugin
Projects
None yet
4 participants