[codex] Fix Sonar TypeScript config resolution#488
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the sonar-project.properties file to explicitly define TypeScript configuration paths. The review feedback identifies an inconsistency in the project's root tsconfig.json file, which references a non-existent path for the Inertia configuration, and suggests correcting this to allow for more natural project resolution and a cleaner Sonar configuration.
| @@ -1 +1,2 @@ | |||
| sonar.projectKey=abtion_adonisjs-template_e6981c04-79a9-46d2-9b70-6706c53d1f55 | |||
| sonar.typescript.tsconfigPaths=tsconfig.json,inertia/tsconfig.json | |||
There was a problem hiding this comment.
Explicitly defining sonar.typescript.tsconfigPaths addresses the resolution issue for Sonar, but there is an underlying inconsistency in the project configuration. The root tsconfig.json (line 8) references ./tsconfig.inertia.json, yet the actual file is located at inertia/tsconfig.json.
By correcting the reference in the root tsconfig.json to point to ./inertia/tsconfig.json, Sonar (and the TypeScript compiler) would be able to resolve the entire project structure naturally. This would also allow you to simplify the Sonar configuration to just the root config, avoiding potential double-analysis or metric inflation that can occur when overlapping configurations are listed explicitly.
What changed
tsconfig.jsonandinertia/tsconfig.json.tool-versionsWhy
Sonar was scanning before dependencies were installed, while both TypeScript entry configs extend
@adonisjs/tsconfigfromnode_modules. That can trigger the warning that a referenced or extendedtsconfig.jsonwas not found and reduce TypeScript analysis accuracy.Impact
The Sonar job should now resolve the intended TypeScript configs reliably and analyze the backend and Inertia frontend with the correct compiler settings.
Validation
npx tsc --showConfig -p tsconfig.jsonnpx tsc --showConfig -p inertia/tsconfig.jsonmainwas blocked by repository rules, so this PR goes through the required checks