Latest Results
fix(tsconfig): apply each referenced project's own `allowJs` (#1198)
## What
Fixes solution-style `tsconfig.json` resolution so that each
**referenced project's own `allowJs`** decides whether it claims a
`.js`/`.jsx`/`.mjs`/`.cjs` file, instead of inheriting the answer from
the parent solution config.
## Why
A common Vite project layout uses a solution `tsconfig.json` that
contains nothing but references:
```jsonc
// tsconfig.json
{ "include": [], "references": [{ "path": "./tsconfig.app.json" }] }
```
```jsonc
// tsconfig.app.json
{
"compilerOptions": {
"composite": true,
"allowJs": true,
"paths": { "@alias/*": ["./src/*"] }
},
"include": ["src/**/*"]
}
```
The root config does **not** set `allowJs`, but the referenced
`tsconfig.app.json` does.
`resolve_tsconfig_solution` used to short-circuit on
`tsconfig.is_file_extension_allowed_in_tsconfig(path)` — i.e. the
**parent's** `allowJs` — *before* iterating the references. For a `.js`
file this returned `false`, so no reference was ever consulted, the
referenced project's `paths` alias never applied, and resolving
`@alias/foo.js` from `src/index.js` failed with `NotFound`.
## How
- Remove the parent-level extension check from
`resolve_tsconfig_solution`.
- Add the extension check as step `0` inside
`is_file_included_in_tsconfig`, where it is evaluated against `self` —
i.e. each referenced project's own `allowJs`.
This keeps the existing `is_glob_match` fast-path behavior intact and
makes ownership consistent with `claims_ownership_of`, which already
evaluates references via `is_file_included_in_tsconfig`.
## Tests
Added `referenced_config_allow_js_uses_own_setting` in
`src/tests/tsconfig_project_references.rs` with a new fixture under
`fixtures/tsconfig/cases/project-references-ref-allow-js/` (root
solution without `allowJs`, referenced app config with `allowJs: true`
and a `paths` alias).
Resolving `@alias/foo.js` from `src/index.js`:
- **Before the fix:** `Err(NotFound("@alias/foo.js"))`
- **After the fix:** `Ok(.../src/foo.js)` Latest Branches
+6%
perf/node-modules-anchor-fast-paths +4%
release-plz-2026-05-28T15-25-06Z -3%
shulaoda:06-03-fix_tsconfig_apply_each_referenced_project_s_own_allowjs_when_resolving_a_solution © 2026 CodSpeed Technology