{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1516","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1516/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1516/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1516/events","html_url":"https://github.com/Microsoft/TypeScript/issues/1516","id":52182983,"number":1516,"title":"TS2134 build error for 2 isolated TS files (shouldn't conflict)","user":{"login":"jt000","id":8368448,"avatar_url":"https://avatars.githubusercontent.com/u/8368448?v=3","gravatar_id":"","url":"https://api.github.com/users/jt000","html_url":"https://github.com/jt000","followers_url":"https://api.github.com/users/jt000/followers","following_url":"https://api.github.com/users/jt000/following{/other_user}","gists_url":"https://api.github.com/users/jt000/gists{/gist_id}","starred_url":"https://api.github.com/users/jt000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jt000/subscriptions","organizations_url":"https://api.github.com/users/jt000/orgs","repos_url":"https://api.github.com/users/jt000/repos","events_url":"https://api.github.com/users/jt000/events{/privacy}","received_events_url":"https://api.github.com/users/jt000/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-12-16T23:41:21Z","updated_at":"2015-02-20T18:20:48Z","closed_at":null,"body":"This is related to borisyankov/DefinitelyTyped#2734\r\nSee repo at https://github.com/jt000/RepoForTypescriptBuildIssue\r\n\r\nThe issue is that in a single project I have two TS files that are for separate scenarios, which don't overlap in functionality (common for nodejs projects that have client, server, and test code in one project). Since there is a commonly named variable with different types the typescript compiler throws the TS2134 build error. However, since neither TS files share common references this should be allowed."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/75291757","html_url":"https://github.com/Microsoft/TypeScript/issues/1516#issuecomment-75291757","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/1516","id":75291757,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T18:20:48Z","updated_at":"2015-02-20T18:20:48Z","body":"@jt000 sorry the delayed response, this fell off my radar during the holidays. \r\n\r\n> we have angular-protractor which exposes a $ var and jquery which also exposes a $ var of a different type. Since they will never be used in the same context, then there should be a way to get this to work without an error message when they are in the same Visual Studio project.\r\n\r\nIf they are never used together in a single application then they should not be passed to the compiler in a single compilation. you can still share your common files using /// references. this way if you ever mistakenly use $ from jQuery in the project that does not use jQuery the compiler will be able to alert you to that instead of silently failing.\r\n\r\nso my suggestion is simply use two projects. for instance, if you have two projects (webpage1, webpage2) where both use jQuery.d.ts, and another not related one that does not. \r\n\r\n+ jQuery.d.ts\r\n+ common.ts\r\n+ webpage1.ts\r\n+ webpage2.ts\r\n+ anotherNotRelatedPage.ts\r\n\r\nin webpage1.ts, webPage2.ts you add /// <reference path=\"jQuery.d.ts\"/> and /// <reference path=\"common.ts\" />\r\n\r\nand call the compiler using:\r\n```\r\ntsc webpage1.ts webpage2.ts\r\n```\r\n\r\nand in anotherNotRelatedPage.ts add a reference to /// <reference path=\"common.ts\" />\r\n\r\nand call the compiler using:\r\n```\r\ntsc anotherNotRelatedPage.ts\r\n```\r\n\r\nthis way you have two \"contexts\", and you are still sharing common.ts\r\n\r\n\r\nyou can do that in VS as well, just create two projects."}}