Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

bchilcott/trpc-ts-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRPC Typescript Problem Reproduction

This repo intends to reproduce an issue where running tsc with noEmit to type-check one package applies its rules to files brought in with a relative import from a separate package, and their subsequent dependencies.

The demo is built with SST, but you don't have to have that running to produce the issue.

The problem stems from packages/web/src/trpc.ts where the type of the trpc router is imported.

Note: noUnusedLocals and noUnusedParameters are explicitly enabled in the web project, but disabled in the api project - to demonstrate the mixing of rules.

To reproduce...

# Install dependencies
pnpm install

# builds the Vite app - or cd to packages/web and run 'pnpm build' there.
pnpm web build