gustavopch / tsc-files

A tiny tool to run `tsc` on specific files without ignoring tsconfig.json
MIT License
234 stars 49 forks source link

tsc-files chokes on jest assertions, tsc doesn't #26

Closed dr-skot closed 2 years ago

dr-skot commented 2 years ago

tsc-files isn't recognizing jest's expect assertions.

Whenever a *.test.ts(x)? file is among my staged files, I get errors like

tsc-files --noEmit --pretty:
src/components/MicButton.test.tsx:18:32 - error TS2339: Property 'toBe' does not exist on type 'Assertion'.
37          expect(muted).toBe(false);

tsc -p tsconfig.json doesn't produce these. Is there a configuration setting that will fix this?

gustavopch commented 2 years ago

Same reason as in https://github.com/gustavopch/tsc-files/issues/20. There are some workarounds there.