Skip to content

Allow comments in tsconfig.json #210

Closed
@RehanSaeed

Description

@RehanSaeed

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.

This is the error I get when adding comments to my tsconfig.json file:

var typescript = require("gulp-typescript");
var typeScriptProject = ts.createProject("tsconfig.json");
Process terminated with code 0.
> cmd.exe /c gulp -b "C:\Test\WebApplication1\WebApplication1" --color --gulpfile "C:\Test\WebApplication1\WebApplication1\Gulpfile.js" build-js
SyntaxError: Unexpected token /
    at Object.parse (native)
    at Function.createProject (C:\Test\WebApplication1\WebApplication1\node_modules\gulp-typescript\release\main.js:195:40)
    at Object.<anonymous> (C:\Test\WebApplication1\WebApplication1\Gulpfile.js:68:28)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Liftoff.handleArguments (C:\Test\WebApplication1\WebApplication1\node_modules\gulp\bin\gulp.js:116:3)
    at Liftoff.<anonymous> (C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\liftoff\index.js:192:16)
    at module.exports (C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\liftoff\node_modules\flagged-respawn\index.js:17:3)
Process terminated with code 8.
    at Liftoff.<anonymous> (C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\liftoff\index.js:185:9)
    at C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\liftoff\index.js:159:9
    at C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\v8flags\index.js:99:14
    at C:\Test\WebApplication1\WebApplication1\node_modules\gulp\node_modules\v8flags\index.js:38:7
    at process._tickCallback (node.js:419:13)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions