microsoft/just

tscRunner: unable to use build mode with other arguments

Hotell opened this issue · 0 comments

Issue #1

Current:

tscTask({build:'tsconfig.json', pretty: true})
Error: Command failed: "/path-to-project/node_modules/typescript/lib/tsc.js" --pretty --build "/path-to-project/tsconfig.json"

 ❌ error TS6369: Option '--build' must be the first command line argument.

Expected:

tscTask({build:'tsconfig.json', pretty: true})
Executing: "/bin/node" "/path-to-project/node_modules/typescript/lib/tsc.js" --build "/path-to-project/tsconfig.json" --pretty

Done ✅

solution #1

  • additional logic for re-ordering args is required

Issue #2

  • tscRunner accepts any TS options although build mode has restricted options support.
  • supported options with build mode
    2021-11-08 at 15 43

solution #2

  • checking if user uses invalid options with build mode (imho this will be reported by native TSC if issue 1 is fixed. From DX perspective the typings needs to be revamped via discriminant unions so compiler shows only available options for particular mode