I'm battling to learn Electron & TypeScript at the same time so this might be really stupid, but I can't get promises to work from this starting project. I've tried several slightly different ways but here's the simplest:
const one = new Promise<string>((resolve, reject) => {});
Error is "Promise only refers to a type, but is being used as a value here" and it suggests I need to change my lib compiler option to es2015 or later.
I've tried adding to my tsconfig.json
"lib": [ "es2018", "dom" ]
Any suggestions?
[edit: a friend suggested setting "target":"esnext" and miraculously that worked, but why would that be needed? I don't want to have to use "esnext" - it's not like Promise is new!]