{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5049","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5049/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5049/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5049/events","html_url":"https://github.com/Microsoft/TypeScript/issues/5049","id":109206169,"number":5049,"title":"require untyped JS file","user":{"login":"EToreo","id":1248716,"avatar_url":"https://avatars.githubusercontent.com/u/1248716?v=3","gravatar_id":"","url":"https://api.github.com/users/EToreo","html_url":"https://github.com/EToreo","followers_url":"https://api.github.com/users/EToreo/followers","following_url":"https://api.github.com/users/EToreo/following{/other_user}","gists_url":"https://api.github.com/users/EToreo/gists{/gist_id}","starred_url":"https://api.github.com/users/EToreo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EToreo/subscriptions","organizations_url":"https://api.github.com/users/EToreo/orgs","repos_url":"https://api.github.com/users/EToreo/repos","events_url":"https://api.github.com/users/EToreo/events{/privacy}","received_events_url":"https://api.github.com/users/EToreo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2015-10-01T00:24:38Z","updated_at":"2016-09-07T20:35:34Z","closed_at":"2015-11-13T06:27:59Z","body":"I am working with typescript 1.6.2 and trying to write some newer sections of code with it.  The problem is, I need to consume other native JavaScript code I have already writen and am not prepared to convert to TypeScript just yet.\r\n\r\nSo I would like to do something like this (where lib/helper.js is a file I'm not ready to convert to TS yet):\r\n```ts\r\nvar helper = require('../lib/helper');\r\n```\r\n\r\nWhen I try to compile this, I get an error: `error TS2304: Cannot find name 'require'`\r\n\r\nTo get around this I add:\r\n```ts\r\ndeclare function require(path: string) : any;\r\nvar helper = require('../lib/helper');\r\n```\r\n\r\n Is there a way to have TypeScript use an untyped common JS file without this \"hack\"?  Without it, it seems that TypeScript is only good for new projects or 100% adoption.  I would like to see a path that allows me to casually convert my very large project to it a piece at a time. "},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/245409551","html_url":"https://github.com/Microsoft/TypeScript/issues/5049#issuecomment-245409551","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5049","id":245409551,"user":{"login":"whitecolor","id":736697,"avatar_url":"https://avatars.githubusercontent.com/u/736697?v=3","gravatar_id":"","url":"https://api.github.com/users/whitecolor","html_url":"https://github.com/whitecolor","followers_url":"https://api.github.com/users/whitecolor/followers","following_url":"https://api.github.com/users/whitecolor/following{/other_user}","gists_url":"https://api.github.com/users/whitecolor/gists{/gist_id}","starred_url":"https://api.github.com/users/whitecolor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitecolor/subscriptions","organizations_url":"https://api.github.com/users/whitecolor/orgs","repos_url":"https://api.github.com/users/whitecolor/repos","events_url":"https://api.github.com/users/whitecolor/events{/privacy}","received_events_url":"https://api.github.com/users/whitecolor/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T20:35:34Z","updated_at":"2016-09-07T20:35:34Z","body":"@mhegazy ok it woks, I think maybe the problem was that it there where to many JS files to to handle, at least I have to reload vscode because it consumed 50% CPU,, probably allowJS is not a good option for a big project, though after reload it seem to work ok. \r\n\r\nThanks again)"}}
{"actor":{"display_login":"whitecolor"}}