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)` feat(tsconfig): support package.json imports field in extends (#1199)
## What
Resolve `#`-prefixed Node.js subpath imports in tsconfig `extends` through the nearest `package.json` `imports` field:
```jsonc
// package.json
{ "imports": { "#base": "./common.tsconfig.json" } }
// tsconfig.json
{ "extends": "#base" }
```
Previously this failed with `TsconfigNotFound`: `get_extended_tsconfig_path` only handled `/`, `.`/`..`, and bare package specifiers (the last via `exports`/`node_modules`, which never consults `imports`).
## Why
TypeScript supports this — it's used in monorepos to avoid brittle `../../../tsconfig.json` paths. Verified against `typescript-go`: `tsgo --showConfig` resolves the fixture to the same targets this PR asserts (`#string` → es2020, `#conditional` node-branch → es6).
Reported in rolldown/rolldown#9611 (labeled `bug: upstream`).
## How
- New `Some(b'#')` arm in `get_extended_tsconfig_path` that routes through `load_package_imports` — the same wrapper the resolver uses for `require("#x")`, so it gets the correct package-scope lookup (`LOOKUP_PACKAGE_SCOPE`) and result verification (`resolve_esm_match`).
- Extracted `tsconfig_extends_resolver` so the `#` (imports) and bare-package (`exports`/`node_modules`) arms share one lookup config (conditions `["node", "import"]`) — `extends: "pkg"` and `extends: "#pkg"` now agree on which condition wins.
- An undefined `#import` (or a missing target) is reported as `TsconfigNotFound`, consistent with how a missing bare-package or relative `extends` target is reported — and with `tsgo`, which emits `File '#missing' not found`.
## Tests
One fixture (`fixtures/tsconfig/cases/extends-imports/`) and one test (`test_extend_imports`) covering, via its `package.json` `imports` map:
- `#string` → string target → `target: ES2020`
- `#conditional` → `{ node, default }` object → `node` wins over `default` → `target: ES2015`
- `extends: "#missing"` (not in `imports`) → `TsconfigNotFound`
All cross-checked against `tsgo` (es2020 / es6 / `File '#missing' not found`).
🤖 Generated with [Claude Code](https://claude.com/claude-code) 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