-
-
Notifications
You must be signed in to change notification settings - Fork 542
Description
This is technically 2 features in one:
a) re-export @tsconfig/bases so that a user's tsconfig can, for example, "extends": "ts-node/node14/tsconfig.json"
b) in the absence of a tsconfig, check node version and use a suitable default.
https://github.com/tsconfig/bases
This allows ts-node to handle bare scripts using modern language features. For example, bigint literals require a modern "target" option which tsc does not adopt by default. If someone tried to write a ts-node shebang script using bigint literals, it would fail to compile unless they accompanied it with a tsconfig.json.
Note: changelog below mentions CLI and programmatic flags to disable this automatic base config.
Decided that was not necessary but put an implementation in #1249
TODO
- add CLI flag
--skip-default-project- UPDATE decided to omit this feature until it is requested, per discord discussion below.
Users can always create atsconfig.jsonto suppress default project, or specify--compiler-optionsto override options)
- UPDATE decided to omit this feature until it is requested, per discord discussion below.
- update programmatic option to match?
skipDefaultProject?- not implemented, see rationale above
- what to name the CLI flag
- https://discord.com/channels/508357248330760243/508357707602853888/814950988069732352
--no-implicit-project--no-implicit-compiler-options
- extract CLI flag to another PR; do not implement it in this first pass
- add tests
- newer @tsconfig/bases are incompatible with Typescript 2.7: how to handle this?
- can check
ts.ScriptTargetandts.libsto ensure they have the necessary entries. If node14 config is incompatible, try node12, then node10 - TS 3.4 added target ES2019 but does not have the necessary
require('typescript').libsentries for the node12 tsconfig, so checking libs is necessary
- can check