TypeStrong / ts-node

TypeScript execution and REPL for node.js
https://typestrong.org/ts-node
MIT License
12.83k stars 533 forks source link

Log warning when "target" is too high for the node version #1248

Open cspotcode opened 3 years ago

cspotcode commented 3 years ago

Blocked by #1445

Building off of #1202, we know the maximum "target" you can use for the given node version, so we can log a helpful warning when your target is wrong:

Warning: You are using a "target" option that may be incompatible with your node version.
For node vXYZ we recommend "target": "es2018" or lower.
To disable this warning, add the following to your tsconfig:
    "ts-node": {"disableNodeCompatibilityWarnings": true}
To override your "target" within ts-node, add the following to your tsconfig:
    "ts-node": {"compilerOptions": {"target": "es2018"}}
To derive your tsconfig from a recommended set of options, add the following to your tsconfig:
    "extends": "ts-node/node12/tsconfig.json"

Questions

cspotcode commented 3 years ago

We discussed this on Discord: https://discord.com/channels/508357248330760243/508357707602853888/843546169752813589

Conclusions:

Questions