You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently tsconfig.json is used both by tsc and typescript language service for IDE support.
The tsconfig.json need by tsc and typescript language service could be different:
For tsc, files: [] works just fine and actually have better control on what should be published
For typescript language service, exclude: [] works much better because when adding new file, you either need to:
Add the file to files: []
Reference by another file that can be resolved from files: []
Also, when package author write tests also in TypeScript, he may not want to have the tests be compiled and published along with source code.
I couldn't find a way to achieve this.
There are a few possible solutions:
a. add devExclude/devFiles in tsconfig.json. typescript language service will use this list if available.
b. Allow typescript language service to be configurable to use another config file, e.g. tsconfig.dev.json
c. Allow tsc to be configurable that by default use another config file, e.g. tsconfig.build.json
I'm aware that I can do tsc -p <directory>, but that wouldn't solve case where .ts and .spec.ts live in the same folder. Also, that's extra typing. The best case is to run tsc at project root and everything will just work.
Is there a .typescriptrc file available to add these options?
The text was updated successfully, but these errors were encountered:
So, c. I believe is currently supported - you can now have two tsconfig.json files and point using -p, but IDE plugins have not caught up. Also, there's the proposal for include that allows the .spec.ts files to also be compiled alongside (excited for this one to land).
Currently
tsconfig.json
is used both bytsc
andtypescript language service
for IDE support.The
tsconfig.json
need bytsc
andtypescript language service
could be different:tsc
,files: []
works just fine and actually have better control on what should be publishedtypescript language service
,exclude: []
works much better because when adding new file, you either need to:files: []
files: []
Also, when package author write tests also in TypeScript, he may not want to have the tests be compiled and published along with source code.
I couldn't find a way to achieve this.
There are a few possible solutions:
a. add
devExclude/devFiles
intsconfig.json
.typescript language service
will use this list if available.b. Allow
typescript language service
to be configurable to use another config file, e.g.tsconfig.dev.json
c. Allow
tsc
to be configurable that by default use another config file, e.g.tsconfig.build.json
I'm aware that I can do
tsc -p <directory>
, but that wouldn't solve case where.ts
and.spec.ts
live in the same folder. Also, that's extra typing. The best case is to runtsc
at project root and everything will just work.Is there a
.typescriptrc
file available to add these options?The text was updated successfully, but these errors were encountered: