-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
Description
π Search Terms
typeroots triple slash directives ordering
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about reference directives
β― Playground Link
No response
π» Code
We are explicitly including our own types in typeRoots before node_modules/@types:
{
"compilerOptions": {
"typeRoots": ["src/types", "node_modules/@types"]because we're making some custom changes to js/node types. This has been working great until we recently tried to switch to vitest which includes vite which has:
/// <reference types="node" />in a file, which breaks some of our types as we have conflicting interfaces with @types/node
π Actual behavior
vitest β vite β node types is discovered before typeRoots is processed, meaning typeRoots ordering is effectively useless as any dependency can just force type injections before they're processed.
π Expected behavior
typeRoots ordering should apply first, THEN types from dependencies
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified