#Can you type check a TS file without emitting it, but emit all other TS files?

1 messages · Page 1 of 1 (latest)

atomic rivet
#

I feel like the answer to my question should be in the tsconfig reference, but I'm not finding a property for this.

I have a typescript project with many files. Some of them are *.test.ts files. These are tests and it is important to me that they are type checked, but I don't want them to be included in the final output.

I know the directory structure is relevant to answering this question, but I actually have two projects with unrelated directory structures and I want to know how to do this with both:

  1. One project has separate /src and /test directories.
  2. In the other, source and test files share the same root and are intermingled in the same folders
#

Can you type check a TS file without emitting it, but emit all other TS files?

atomic rivet
#

I may have asked this in a way that takes a lot of effort to answer. Knowing that this property exists (or not) as a tsconfig prop would help me immensely

atomic rivet
#

!helper

cold timberBOT
#

:warning: Please wait a bit longer. You can ping helpers <t:1688774451:R>.

atomic rivet
#

!helper

obtuse aurora
#

isn't using two tsconfigs enough @atomic rivet

atomic rivet
obtuse aurora
#

yes

#

but you aren't building using vscode

#

just do tsc -p tsconfig.build.json

atomic rivet
obtuse aurora
#

no like

#

what

#

i don't understand how this is confusing
tsconfig.json includes all files
tsconfig.build.json includes only non test files

atomic rivet
#

It's not used by anything else?

obtuse aurora
atomic rivet
# obtuse aurora pretty much

ah ok. I hadn't considered that as a route I could take. So I guess I'm supposed to have a base tsconfig they both share so they don't get out of sync

#

Thank you @obtuse aurora

#

!resolve

obtuse aurora
atomic rivet
#

i usually import the base from the tsconfig that the ide uses that way its just adding more files but you do you
not sure I understand. how many ts configs are there and which extends which?

balmy bolt
#

Hello, can I help you?