TypeScript `tsc` taking a long time for type checking in a large React codebase with GraphQL generated types and MUI theme customization. The bottleneck is Check time due to complex Apollo Client generics and module augmentation.
-
Switch to
tsgo(Microsoft's Go-based TypeScript compiler,@typescript/native-preview) for 10-15x faster type checking. Install withnpm install -D @typescript/native-previewand run withnpx tsgo. -
Fix MUI module augmentation to use
@mui/material/stylesinstead of e.g.@mui/material/styles/createPalette- tsgo is stricter about module paths and the official MUI docs recommend the former. -
Move type augmentations to a dedicated
.d.tsfile explicitly included intsconfig.jsonfiles array - tsgo handles this better than inline augmentations in.tsfiles. Example: createtheme.d.tswith your Palette extensions and add it to"files": ["theme.d.ts"]in tsconfig.json. -
Replace
baseUrlwithpathsin tsconfig.json as tsgo has removed support for baseUrl.