tscRunner: unable to use build mode with other arguments
Hotell opened this issue · 0 comments
Hotell commented
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 althoughbuild
mode has restricted options support.- supported options with build mode
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