Skip to content

Allow comments in tsconfig.json #4987

Description

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.

Activity

  1. mhegazy commented on Sep 28, 2015

    @mhegazy
    Contributor

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

  2. tinganho commented on Sep 29, 2015

    @tinganho
    Contributor

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

  3. slikts commented on Sep 29, 2015

    @slikts

    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.

  4. sarod commented on Oct 28, 2015

    @sarod
    Contributor

    👍
    This would be very useful to document excludes for instance

  5. mhegazy commented on Oct 28, 2015

    @mhegazy
    Contributor

    PRs are welcomed here.

  6. mhegazy commented on Nov 2, 2015

    @mhegazy
    Contributor
  7. ShawnTalbert commented on Nov 22, 2015

    @ShawnTalbert

    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.

  8. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions