fix: check jsconfig.json when tsconfig.json is missing in getPathAliases

Fixes #7649
This commit is contained in:
jycouet
2026-01-28 00:14:59 +01:00
parent b0a6fb89c4
commit ff5d5e1ea9

View File

@@ -120,7 +120,10 @@ function getPathAliasesRecursive(
}
function getPathAliases(cwd: string): Record<string, string> | null {
const tsConfigPath = path.join(cwd, "tsconfig.json");
let tsConfigPath = path.join(cwd, "tsconfig.json");
if (!fs.existsSync(tsConfigPath)) {
tsConfigPath = path.join(cwd, "jsconfig.json");
}
if (!fs.existsSync(tsConfigPath)) {
return null;
}