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

tsc CLI: allow boolean options to have explicit false value #10967

Closed
alexeagle opened this issue Sep 17, 2016 · 4 comments
Closed

tsc CLI: allow boolean options to have explicit false value #10967

alexeagle opened this issue Sep 17, 2016 · 4 comments
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@alexeagle
Copy link
Contributor

I have some .d.ts files referenced in the project (from Angular 2) which are not compatible with --strictNullChecks.
I want to enforce strict nulls within my own project though. So I have tsconfig.json with 'strictNullChecks': true specifically to direct my editor to underline these.
In our google-internal build system, we have our own tsc wrapper that does specific type-checks (and uses a different generated tsconfig.json so this all works fine in the build.
But, users benefit from being able to just run a vanilla tsc command on the command line to diagnose setup issues.

So, I'd like to be able to override any setting in the tsconfig.json with a command-line option. In some cases I can do so (eg --target=es5 overrides 'target': 'es6') but with boolean options only the true value can be passed, eg --strictNullChecks

I propose --strictNullChecks=false be accepted on CLI

@evmar
Copy link
Contributor

evmar commented Sep 19, 2016

(In case anyone else is wondering, I checked the tsc source and it appears that there's no way of passing in false, such as --noStrictNullChecks.)

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels Sep 19, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Sep 19, 2016

we can add a look-ahead for boolean-based flags, and consume the result iff it is true|false.

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this and removed In Discussion Not yet reached consensus labels Sep 28, 2016
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Sep 28, 2016
@RyanCavanaugh
Copy link
Member

Accepting PRs for this

HerringtonDarkholme added a commit to HerringtonDarkholme/TypeScript that referenced this issue Oct 23, 2016
HerringtonDarkholme added a commit to HerringtonDarkholme/TypeScript that referenced this issue Oct 23, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Oct 24, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, Community Oct 24, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Oct 24, 2016

thanks @HerringtonDarkholme!

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants