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

Allow comments in tsconfig.json #4987

Closed
RehanSaeed opened this issue Sep 26, 2015 · 7 comments
Closed

Allow comments in tsconfig.json #4987

RehanSaeed opened this issue Sep 26, 2015 · 7 comments
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@RehanSaeed
Copy link

Comments don't seem to be allowed in the tsconfig.json file. See this article for why it is ok according to Douglas Crockford to add them to json config files.

I initially raised this issue with gulp-typescript as I'm trying to use that Gulp task in my ASP.NET 5 project to compile my .ts files to .js but I'm getting errors and the developer has pointed me here.

My goal is to add TypeScript support to ASP.NET MVC Boilerplate which provides an ASP.NET 5 project template with lots of helpful comments and features built in. I'm currently having to resort to a separate tsconfig.html file to write comments about the file. The comments include a little info about what the file is for, a useful link to the tsconfig.json documentation and a few reasons for the chosen default settings.

Many other similar json config files already support comments. Examples are: JSHint (.jshintrc file), JSCS (.jscsrc file), TSLint (tslint.json file). The first two do not use a file with a .json file extension which may have something to do with the use of comments.

@DanielRosenwasser DanielRosenwasser added the Suggestion An idea for TypeScript label Sep 28, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Sep 28, 2015

@tinganho had a pull request for this. @tinganho feel free to resubmit the comments PR.

@tinganho
Copy link
Contributor

I will do, just a little bit busy with other things right now.

@slikts
Copy link

slikts commented Sep 29, 2015

Having comments in the configs would be very helpful, and JSON as a config format is an exception in not having them. It would also be nice to add support for trailing commas in the same way to make editing JSON less fiddly.

@sarod
Copy link
Contributor

sarod commented Oct 28, 2015

👍
This would be very useful to document excludes for instance

@mhegazy mhegazy added the Help Wanted You can do this label Oct 28, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Oct 28, 2015

PRs are welcomed here.

sarod added a commit to sarod/TypeScript that referenced this issue Oct 29, 2015
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 2, 2015
@mhegazy mhegazy added this to the TypeScript 1.8 milestone Nov 2, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Nov 2, 2015

thanks @sarod!

@ShawnTalbert
Copy link

It would be great if this format followed the popular HOCON format

I realize this is merged, but its the most relevant ticket I found to mention it.

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
7 participants