/tsnode-compile-issue

shows compile issues between tsc and ts-node using > es6

Primary LanguageTypeScript

tsnode-compile-issue

shows compile issues between tsc and ts-node using > es6

steps to reproduce

  • clone the repo

notice target is "ES2020"

  "compilerOptions": {
    "target": "ES2020",
  • run yarn install
  • run yarn build

you'll see no errors...

  • run yarn test

you'll see compile errors from ts-node

tsnode-compile-issue\src\code-list.logic.ts:12
        CodeListLogic.cache[key] = list ?? {};
                                         ^

SyntaxError: Unexpected token '?'

  • change tsconfig target to es6
  "compilerOptions": {
    "target": "es6",
  • run yarn test code compiles / runs fine (yes, tests fail 😛)