Closed sramam closed 2 years ago
This is effectively a duplicate of #871 and I've documented that one extensively, so I'll leave most of the details to it.
Some issues with your set-up that you may have later discovered:
include
: test
can't be added there as it will make it so your tests are also compiled. Other than that being unnecessary, it could also affect directory structure etc. In https://github.com/jaredpalmer/tsdx/issues/871#issuecomment-695822562, I recommend using a tsconfig.build.json
to get around this -- one tsconfig
for type-checking all your files, one for building specific files.types
: you may be misunderstanding how tsconfig
's types
field works. this will make it ignore all @types
libraries except for @types/jest
, which I don't think you mean to do. I recommend using @jest/globals
(or jest-without-globals
for older versions of Jest) to avoid globals entirely, but if you are using globals, TSDX already comes installed with @types/jest
, which TypeScript will automatically detect and use in your node_modules
so long as your typeRoots
and types
haven't been configured otherwiserootDir
: see the comment in the tsconfig.json
as well as https://github.com/jaredpalmer/tsdx/issues/871#issuecomment-695822562 's various links
Current Behavior
I am using tsdx to setup a headless monorepo, meaning I use the basic template. Very useful. So thank you.
However, to get VSCode + jest to work correctly on the test files, I keep having to make this adjustment to tsconfig.json
Expected behavior
My needs don't seem special and I'd suspect these should be the defaults in the template.