{"action":"opened","issue":{"url":"https://api.github.com/repos/wjohnsto/tsconfig-glob/issues/6","labels_url":"https://api.github.com/repos/wjohnsto/tsconfig-glob/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/wjohnsto/tsconfig-glob/issues/6/comments","events_url":"https://api.github.com/repos/wjohnsto/tsconfig-glob/issues/6/events","html_url":"https://github.com/wjohnsto/tsconfig-glob/issues/6","id":118090682,"number":6,"title":"tsconfig-glob 0.3.1 corrupts tsconfig.json by removing final EOL character","user":{"login":"rob3c","id":1098077,"avatar_url":"https://avatars.githubusercontent.com/u/1098077?v=3","gravatar_id":"","url":"https://api.github.com/users/rob3c","html_url":"https://github.com/rob3c","followers_url":"https://api.github.com/users/rob3c/followers","following_url":"https://api.github.com/users/rob3c/following{/other_user}","gists_url":"https://api.github.com/users/rob3c/gists{/gist_id}","starred_url":"https://api.github.com/users/rob3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob3c/subscriptions","organizations_url":"https://api.github.com/users/rob3c/orgs","repos_url":"https://api.github.com/users/rob3c/repos","events_url":"https://api.github.com/users/rob3c/events{/privacy}","received_events_url":"https://api.github.com/users/rob3c/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-20T17:46:49Z","updated_at":"2015-11-20T17:46:49Z","closed_at":null,"body":"First, thanks for this wonderfully convenient module! I use with this gulp watch task in VSCode all the time.\r\nThis file watcher code works fine in tsconfig-glob 0.2.1, but fails in 0.3.1 (at least on Windows):\r\n\r\n```\r\n'use strict';\r\nvar gulp = require('gulp');\r\nvar tsConfig = require('tsconfig-glob');\r\n\r\ngulp.task('tsconfig:filesGlob', function tsconfigGlob() {\r\n    return tsConfig({\r\n        configPath: '.',\r\n        cwd: process.cwd(),\r\n        indent: 4\r\n    }, function (err) {\r\n        if (err) {\r\n            console.log('[tsConfig - err] ' + JSON.stringify(err));\r\n        }\r\n    });\r\n});\r\n\r\ngulp.task('watch', [ 'tsconfig:filesGlob' ], function watch() {\r\n    var tsConfigFile = require('./tsconfig.json');\r\n    gulp.watch(tsConfigFile.filesGlob, [ 'tsconfig:filesGlob' ])\r\n        .on('change', reportTSConfigFileChange);\r\n});\r\n\r\nfunction reportTSConfigFileChange(event) {\r\n    console.log('File \"' + event.path + '\" was ' + event.type + '.');\r\n}\r\n```\r\n\r\nThe `require('./tsconfig.json')` call fails because `tsconfig-glob` removes the final EOL after the closing curly brace at the end of the file after it updates the files section in the tsconfig:filesGlob task that watch depends on. This causes node to throw the following SyntaxError \"Unexpected end of input\":\r\n\r\n```\r\nc:\\project>gulp watch\r\n[12:05:44] Using gulpfile c:\\project\\gulpfile.js\r\n[12:05:44] Starting 'tsconfig:filesGlob'...\r\n[12:05:44] Finished 'tsconfig:filesGlob' after 27 ms\r\n[12:05:44] Starting 'watch'...\r\n[12:05:44] 'watch' errored after 5.63 ms\r\n[12:05:44] SyntaxError: c:\\project\\tsconfig.json: Unexpected end of input\r\n    at Object.parse (native)\r\n    at Object.Module._extensions..json (module.js:486:27)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at Gulp.watch (c:\\project\\gulpfile.js:18:24)\r\n    at module.exports (c:\\project\\node_modules\\orchestrator\\lib\\runTask.js:34:7)\r\n    at Gulp.Orchestrator._runTask (c:\\project\\node_modules\\orchestrator\\index.js:273:3)\r\n    at Gulp.Orchestrator._runStep (c:\\project\\node_modules\\orchestrator\\index.js:214:10)\r\n```\r\nMy workaround is to just use 0.2.1 in all projects for now."}}