{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/tslint/pulls/comments/69214609","id":69214609,"diff_hunk":"@@ -46,17 +48,41 @@ export function runTest(testDirectory: string, rulesDirectory?: string | string[\n \n     for (const fileToLint of filesToLint) {\n         const fileBasename = path.basename(fileToLint, FILE_EXTENSION);\n+        const fileCompileName = fileBasename.replace(/\\.lint$/, \"\");\n         const fileText = fs.readFileSync(fileToLint, \"utf8\");\n         const fileTextWithoutMarkup = parse.removeErrorMarkup(fileText);\n         const errorsFromMarkup = parse.parseErrorsFromMarkup(fileText);\n \n+        const compilerOptions = createCompilerOptions();\n+        const compilerHost: ts.CompilerHost = {\n+            fileExists: () => true,\n+            getCanonicalFileName: (filename: string) => filename,\n+            getCurrentDirectory: () => \"\",\n+            getDefaultLibFileName: () => ts.getDefaultLibFileName(compilerOptions),\n+            getNewLine: () => \"\\n\",\n+            getSourceFile: function (filenameToGet: string) {\n+                if (filenameToGet === this.getDefaultLibFileName()) {\n+                    const fileText = fs.readFileSync(ts.getDefaultLibFilePath(compilerOptions)).toString();\n+                    return ts.createSourceFile(filenameToGet, fileText, compilerOptions.target);\n+                } else if (filenameToGet === fileCompileName) {\n+                    return ts.createSourceFile(fileBasename, fileTextWithoutMarkup, compilerOptions.target, true);\n+                }\n+            },\n+            readFile: () => null,\n+            useCaseSensitiveFileNames: () => true,\n+            writeFile: () => null,\n+        };\n+\n+        const program = ts.createProgram([fileCompileName], compilerOptions, compilerHost);\n+        ts.getPreEmitDiagnostics(program);","path":"src/test.ts","position":43,"original_position":43,"commit_id":"00ac14715256882664988e4f883ae16ca9a5fab2","original_commit_id":"00ac14715256882664988e4f883ae16ca9a5fab2","user":{"login":"alexeagle","id":47395,"avatar_url":"https://avatars.githubusercontent.com/u/47395?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false},"body":"comment that this call actually causes the type-checking to occur, and updates the `ts.SourceFile` objects to have symbol table refs","created_at":"2016-06-30T21:33:28Z","updated_at":"2016-06-30T21:33:29Z","html_url":"https://github.com/palantir/tslint/pull/1363#discussion_r69214609","pull_request_url":"https://api.github.com/repos/palantir/tslint/pulls/1363","_links":{"self":{"href":"https://api.github.com/repos/palantir/tslint/pulls/comments/69214609"},"html":{"href":"https://github.com/palantir/tslint/pull/1363#discussion_r69214609"},"pull_request":{"href":"https://api.github.com/repos/palantir/tslint/pulls/1363"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/tslint/pulls/1363","id":75863529,"html_url":"https://github.com/palantir/tslint/pull/1363","diff_url":"https://github.com/palantir/tslint/pull/1363.diff","patch_url":"https://github.com/palantir/tslint/pull/1363.patch","issue_url":"https://api.github.com/repos/palantir/tslint/issues/1363","number":1363,"state":"open","locked":false,"title":"Add optional type information to rules (#1323)","user":{"login":"ScottSWu","id":3599407,"avatar_url":"https://avatars.githubusercontent.com/u/3599407?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottSWu","html_url":"https://github.com/ScottSWu","followers_url":"https://api.github.com/users/ScottSWu/followers","following_url":"https://api.github.com/users/ScottSWu/following{/other_user}","gists_url":"https://api.github.com/users/ScottSWu/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottSWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottSWu/subscriptions","organizations_url":"https://api.github.com/users/ScottSWu/orgs","repos_url":"https://api.github.com/users/ScottSWu/repos","events_url":"https://api.github.com/users/ScottSWu/events{/privacy}","received_events_url":"https://api.github.com/users/ScottSWu/received_events","type":"User","site_admin":false},"body":"* Changed Linter to accept an optional program object in the constructor\r\n  * Added helper functions for creating a program using a tsconfig and getting relevant files\r\n* Created TypedRule class which receives the program object\r\n  * Rules extending this class must implement applyWithProgram\r\n  * Linter passes program to TypedRules if available\r\n* Created ProgramAwareRuleWalker which walks with the program / typechecker\r\n* Added an example restrictPlusOperands rule that uses types","created_at":"2016-06-30T18:00:45Z","updated_at":"2016-06-30T21:33:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0318cfd5f9ae91941f3a1f2b003844af22bbccc8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/palantir/tslint/pulls/1363/commits","review_comments_url":"https://api.github.com/repos/palantir/tslint/pulls/1363/comments","review_comment_url":"https://api.github.com/repos/palantir/tslint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/1363/comments","statuses_url":"https://api.github.com/repos/palantir/tslint/statuses/00ac14715256882664988e4f883ae16ca9a5fab2","head":{"label":"ScottSWu:typechecking-main","ref":"typechecking-main","sha":"00ac14715256882664988e4f883ae16ca9a5fab2","user":{"login":"ScottSWu","id":3599407,"avatar_url":"https://avatars.githubusercontent.com/u/3599407?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottSWu","html_url":"https://github.com/ScottSWu","followers_url":"https://api.github.com/users/ScottSWu/followers","following_url":"https://api.github.com/users/ScottSWu/following{/other_user}","gists_url":"https://api.github.com/users/ScottSWu/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottSWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottSWu/subscriptions","organizations_url":"https://api.github.com/users/ScottSWu/orgs","repos_url":"https://api.github.com/users/ScottSWu/repos","events_url":"https://api.github.com/users/ScottSWu/events{/privacy}","received_events_url":"https://api.github.com/users/ScottSWu/received_events","type":"User","site_admin":false},"repo":{"id":61250193,"name":"tslint","full_name":"ScottSWu/tslint","owner":{"login":"ScottSWu","id":3599407,"avatar_url":"https://avatars.githubusercontent.com/u/3599407?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottSWu","html_url":"https://github.com/ScottSWu","followers_url":"https://api.github.com/users/ScottSWu/followers","following_url":"https://api.github.com/users/ScottSWu/following{/other_user}","gists_url":"https://api.github.com/users/ScottSWu/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottSWu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottSWu/subscriptions","organizations_url":"https://api.github.com/users/ScottSWu/orgs","repos_url":"https://api.github.com/users/ScottSWu/repos","events_url":"https://api.github.com/users/ScottSWu/events{/privacy}","received_events_url":"https://api.github.com/users/ScottSWu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ScottSWu/tslint","description":"An extensible linter for the TypeScript language.","fork":true,"url":"https://api.github.com/repos/ScottSWu/tslint","forks_url":"https://api.github.com/repos/ScottSWu/tslint/forks","keys_url":"https://api.github.com/repos/ScottSWu/tslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottSWu/tslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottSWu/tslint/teams","hooks_url":"https://api.github.com/repos/ScottSWu/tslint/hooks","issue_events_url":"https://api.github.com/repos/ScottSWu/tslint/issues/events{/number}","events_url":"https://api.github.com/repos/ScottSWu/tslint/events","assignees_url":"https://api.github.com/repos/ScottSWu/tslint/assignees{/user}","branches_url":"https://api.github.com/repos/ScottSWu/tslint/branches{/branch}","tags_url":"https://api.github.com/repos/ScottSWu/tslint/tags","blobs_url":"https://api.github.com/repos/ScottSWu/tslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottSWu/tslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottSWu/tslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottSWu/tslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottSWu/tslint/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottSWu/tslint/languages","stargazers_url":"https://api.github.com/repos/ScottSWu/tslint/stargazers","contributors_url":"https://api.github.com/repos/ScottSWu/tslint/contributors","subscribers_url":"https://api.github.com/repos/ScottSWu/tslint/subscribers","subscription_url":"https://api.github.com/repos/ScottSWu/tslint/subscription","commits_url":"https://api.github.com/repos/ScottSWu/tslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottSWu/tslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottSWu/tslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottSWu/tslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottSWu/tslint/contents/{+path}","compare_url":"https://api.github.com/repos/ScottSWu/tslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottSWu/tslint/merges","archive_url":"https://api.github.com/repos/ScottSWu/tslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottSWu/tslint/downloads","issues_url":"https://api.github.com/repos/ScottSWu/tslint/issues{/number}","pulls_url":"https://api.github.com/repos/ScottSWu/tslint/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottSWu/tslint/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottSWu/tslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottSWu/tslint/labels{/name}","releases_url":"https://api.github.com/repos/ScottSWu/tslint/releases{/id}","deployments_url":"https://api.github.com/repos/ScottSWu/tslint/deployments","created_at":"2016-06-16T00:35:37Z","updated_at":"2016-06-16T00:35:38Z","pushed_at":"2016-06-30T18:37:11Z","git_url":"git://github.com/ScottSWu/tslint.git","ssh_url":"git@github.com:ScottSWu/tslint.git","clone_url":"https://github.com/ScottSWu/tslint.git","svn_url":"https://github.com/ScottSWu/tslint","homepage":"http://palantir.github.io/tslint/","size":9920,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"palantir:master","ref":"master","sha":"d3350adb2c67335abd50400ee9d2a9b530360823","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":11672345,"name":"tslint","full_name":"palantir/tslint","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/tslint","description":"An extensible linter for the TypeScript language.","fork":false,"url":"https://api.github.com/repos/palantir/tslint","forks_url":"https://api.github.com/repos/palantir/tslint/forks","keys_url":"https://api.github.com/repos/palantir/tslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/tslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/tslint/teams","hooks_url":"https://api.github.com/repos/palantir/tslint/hooks","issue_events_url":"https://api.github.com/repos/palantir/tslint/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/tslint/events","assignees_url":"https://api.github.com/repos/palantir/tslint/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/tslint/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/tslint/tags","blobs_url":"https://api.github.com/repos/palantir/tslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/tslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/tslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/tslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/tslint/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/tslint/languages","stargazers_url":"https://api.github.com/repos/palantir/tslint/stargazers","contributors_url":"https://api.github.com/repos/palantir/tslint/contributors","subscribers_url":"https://api.github.com/repos/palantir/tslint/subscribers","subscription_url":"https://api.github.com/repos/palantir/tslint/subscription","commits_url":"https://api.github.com/repos/palantir/tslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/tslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/tslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/tslint/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/tslint/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/tslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/tslint/merges","archive_url":"https://api.github.com/repos/palantir/tslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/tslint/downloads","issues_url":"https://api.github.com/repos/palantir/tslint/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/tslint/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/tslint/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/tslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/tslint/labels{/name}","releases_url":"https://api.github.com/repos/palantir/tslint/releases{/id}","deployments_url":"https://api.github.com/repos/palantir/tslint/deployments","created_at":"2013-07-25T22:19:18Z","updated_at":"2016-06-29T16:19:50Z","pushed_at":"2016-06-30T19:42:28Z","git_url":"git://github.com/palantir/tslint.git","ssh_url":"git@github.com:palantir/tslint.git","clone_url":"https://github.com/palantir/tslint.git","svn_url":"https://github.com/palantir/tslint","homepage":"http://palantir.github.io/tslint/","size":11160,"stargazers_count":859,"watchers_count":859,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":226,"mirror_url":null,"open_issues_count":220,"forks":226,"open_issues":220,"watchers":859,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/tslint/pulls/1363"},"html":{"href":"https://github.com/palantir/tslint/pull/1363"},"issue":{"href":"https://api.github.com/repos/palantir/tslint/issues/1363"},"comments":{"href":"https://api.github.com/repos/palantir/tslint/issues/1363/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/tslint/pulls/1363/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/tslint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/tslint/pulls/1363/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/tslint/statuses/00ac14715256882664988e4f883ae16ca9a5fab2"}}}}
{"actor":{"display_login":"alexeagle"}}