-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-export node-relevant @tsconfig/bases; use by default in absence of a tsconfig file #1202
Comments
Will need to add an option If you really want This is verbose; the rationale is that people will rarely want to do this. The default, |
When implementing, should be sure to avoid triggering any logic that cares about the path of the tsconfig file. In other words, we don't want to affect scope, or ignore, or anything like that. We just want to get the tsconfig compilerOptions such as "target" and "lib". |
* Implementation * fix * fix lint * fix * fix * cleanup * fallback to older @tsconfig/node* config when we detect an incompatibility with the lib or target options * lint fix * WIP * Add CLI and programmatic option to disable implicit compiler options * Remove --no-implicit-compiler-options flag and programmatic option; it is implemented in another PR * add tests * fix tests * fix tests * fix tests
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
--skip-default-project
Users can always create a
tsconfig.json
to suppress default project, or specify--compiler-options
to override options)skipDefaultProject
?--no-implicit-project
--no-implicit-compiler-options
ts.ScriptTarget
andts.libs
to ensure they have the necessary entries. If node14 config is incompatible, try node12, then node10require('typescript').libs
entries for the node12 tsconfig, so checking libs is necessaryThe text was updated successfully, but these errors were encountered: