Skip to content

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

@Hotell

Description

@Hotell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions