Since IDEs & other tools won't be hip to what tshy does behind the scenes, a consumer is going to need a reasonable tsconfig.json. But because TS' default configuration is not what tshy uses, the actual configuration will be opaque to other tools. The Actual configuration needs to be as static as is feasible to play nicely.
I have a few suggestions:
Export a tsconfig.json from tshy (e.g., tshy/tsconfig.json) and tell consumers to extend this. There is precedent for this sort of thing.
noEmit: true should be in such a recommended configuration, and it should be ignored by tshy internally.
Because: use of tshy shouldn't mean tsc cannot be used safely. Given that tsc's default behavior is to output its artifacts alongside its sources, and tshy recommends omitting e.g., outDir from the TS config, this is annoying af. I wanted to use tsc to check my types (because #37), so I added noEmit: true to my compilerOptions. But this breaks tshy (e.g., Error: ENOENT: no such file or directory, open '.tshy-build/esm/package.json').
Consumers should be able to use include, exclude, and/or files safely. This has implications for stuff like @typescript-eslint (probably). Because in tsconfig.json, paths are relative to the config file, a static tshy/tsconfig.json cannot provide these properties itself. Maybe best to just tell the consumer what those should be? Or...
A tshy init would help with generating/updating a proper tsconfig.json for use with tshy.
Since IDEs & other tools won't be hip to what
tshy
does behind the scenes, a consumer is going to need a reasonabletsconfig.json
. But because TS' default configuration is not whattshy
uses, the actual configuration will be opaque to other tools. The Actual configuration needs to be as static as is feasible to play nicely.I have a few suggestions:
tsconfig.json
fromtshy
(e.g.,tshy/tsconfig.json
) and tell consumers toextend
this. There is precedent for this sort of thing.noEmit: true
should be in such a recommended configuration, and it should be ignored bytshy
internally.Because: use of
tshy
shouldn't meantsc
cannot be used safely. Given thattsc
's default behavior is to output its artifacts alongside its sources, andtshy
recommends omitting e.g.,outDir
from the TS config, this is annoying af. I wanted to usetsc
to check my types (because #37), so I addednoEmit: true
to mycompilerOptions
. But this breakstshy
(e.g.,Error: ENOENT: no such file or directory, open '.tshy-build/esm/package.json'
).include
,exclude
, and/orfiles
safely. This has implications for stuff like@typescript-eslint
(probably). Because intsconfig.json
, paths are relative to the config file, a statictshy/tsconfig.json
cannot provide these properties itself. Maybe best to just tell the consumer what those should be? Or...tshy init
would help with generating/updating a propertsconfig.json
for use withtshy
.