Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tscRunner: unable to use build mode with other arguments #561

Open
Hotell opened this issue Nov 8, 2021 · 0 comments
Open

tscRunner: unable to use build mode with other arguments #561

Hotell opened this issue Nov 8, 2021 · 0 comments

Comments

@Hotell
Copy link

Hotell commented Nov 8, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant