deno/libs/resolver
Nayeem Rahman 7a9ab843bd
feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843)
- Each workspace directory is probed for a `tsconfig.json`.
- These and any that are included by their `references` are put into a
list ordered by priority.
  - A tsconfig has lower priority than its `references`.
- An earlier listed entry in `references` has higher priority than a
later one.
- A probed tsconfig in an inner directory has higher priority than an
outer one. Their `references` would be interspersed between them.
- Each tsconfig has a filter based on its `files`, `include` and
`exclude` fields. If it doesn't have `files` or `include`, it will match
any path in its containing directory not exempted by `exclude`.
- For type-checking, each root path will be allocated compiler options
based on the first tsconfig it whose filter it matches from this list.
- Only if it doesn't match any tsconfig, it will fall back to using the
nearest `deno.json`. If it's a workspace member and the root `deno.json`
has `compilerOptions`, these will be merged using the same logic from
`extends`.

Inheritance between configs strictly occurs via `extends` in a
`tsconfig.json`, and between workspace member and root `deno.json`s'
`compilerOptions`. There is no implicit inheritance between
`tsconfig.json` and `deno.json`.

The default compiler options currently applied against tsconfigs are
Deno's normal defaults, with the exception of `lib`. The default value
for `lib` is `["deno.window", "deno.unstable", "dom"]` for files in the
scope of a tsconfig with `lib` unspecified. This behaviour is depended
on by, for example, the template project created by `create-vite ->
svelte`. I expect we'll add more such exceptions over time with other
fields.
2025-06-26 21:17:07 +00:00
..
npm fix: import.meta.resolve - do not error for non-existent files in npm packages (#29741) 2025-06-16 12:03:12 +02:00
Cargo.toml feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
cjs.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
clippy.toml refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
collections.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
deno_json.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
display.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
factory.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
file_fetcher.rs feat(unstable): bytes and text imports (#29855) 2025-06-26 11:21:16 -04:00
graph.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
import_map.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
lib.rs fix: import.meta.resolve - do not error for non-existent files in npm packages (#29741) 2025-06-16 12:03:12 +02:00
lockfile.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
npmrc.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
README.md refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
sync.rs refactor: add deno_package_json crate (#29743) 2025-06-13 22:55:12 +00:00
workspace.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00

deno_resolver

Deno resolution algorithm.