Skip to content

[Feature Proposal] How to use tsc with compilerOptions from tsconfig.json? #9516

@cookiengineer

Description

@cookiengineer

The tsc binary does not allow to use a tsconfig.json with files as arguments in combination.

Why is this the case? Is there any reason for that? It would make things so much easier for third-party linting processes (such as the one in syntastic / VIM) as they simply could respect the identical config as the build setup.

The problem here is diversion of user-based config (flags for tsc to lint files that are setup in the IDE's config) to project-based config. If a project uses different flags (e.g. --module) you cannot migrate IDE configs easily to the JSON config in the tsconfig.json.

tsc --project /path/to/my/project/with/tsconfig.json/ somefile.ts someotherfile.ts

The above example is not possible because of the following error message:

error TS5042: Option 'project' cannot be mixed with source files on a command line.

Is there any chance the tsc binary can get a flag that can respect the tsconfig.json file's compiler options?
In an optimum world, someone could use something like this:

tsc --config /path/to/tsconfig.json somefile.ts someotherfile.ts;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions