{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/tslint/pulls/comments/23407200","id":23407200,"diff_hunk":"@@ -34,61 +35,51 @@ class UseStrictWalker extends Lint.ScopeAwareRuleWalker<{}> {\n         return {};\n     }\n \n-    public visitModuleDeclaration(node: TypeScript.ModuleDeclarationSyntax): void {\n-        var childCount = TypeScript.childCount(node.modifiers);\n+    public visitModuleDeclaration(node: ts.ModuleDeclaration) {\n+        var modifiers = node.modifiers;\n+        var hasDeclareModifier = (modifiers != null) && (modifiers.length > 0) && (modifiers[0].kind === ts.SyntaxKind.DeclareKeyword);\n \n         // current depth is 2: global scope and the scope created by this module\n-        // but skip declare module statements\n-        if (this.getCurrentDepth() === 2 &&\n-            !(childCount > 0 && TypeScript.childAt(node.modifiers, 0).kind() === TypeScript.SyntaxKind.DeclareKeyword)) {\n-\n-            if (this.hasOption(UseStrictWalker.OPTION_CHECK_MODULE)) {\n-                this.checkUseStrict(node, node.moduleElements);\n+        if (this.getCurrentDepth() === 2 && !hasDeclareModifier) {\n+            if (node.body != null && this.hasOption(UseStrictWalker.OPTION_CHECK_MODULE)) {\n+                this.handleBlock(node, <ts.Block> node.body);","path":"src/rules/useStrictRule.ts","position":37,"original_position":37,"commit_id":"f5ee295a609ef4f9676108b7a1ffc00d50d955d4","original_commit_id":"f5ee295a609ef4f9676108b7a1ffc00d50d955d4","user":{"login":"gscshoyru","id":2463526,"avatar_url":"https://avatars.githubusercontent.com/u/2463526?v=3","gravatar_id":"","url":"https://api.github.com/users/gscshoyru","html_url":"https://github.com/gscshoyru","followers_url":"https://api.github.com/users/gscshoyru/followers","following_url":"https://api.github.com/users/gscshoyru/following{/other_user}","gists_url":"https://api.github.com/users/gscshoyru/gists{/gist_id}","starred_url":"https://api.github.com/users/gscshoyru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gscshoyru/subscriptions","organizations_url":"https://api.github.com/users/gscshoyru/orgs","repos_url":"https://api.github.com/users/gscshoyru/repos","events_url":"https://api.github.com/users/gscshoyru/events{/privacy}","received_events_url":"https://api.github.com/users/gscshoyru/received_events","type":"User","site_admin":false},"body":"How do you know this isn't a ModuleDeclaration here? (Is it because of the declaration modifier? If so, that's fine, I'm just confused/curious. Also, minor detail -- this should probably be ModuleBlock and not Block, to match up with how body is typed. ","created_at":"2015-01-22T20:31:59Z","updated_at":"2015-01-22T20:31:59Z","html_url":"https://github.com/palantir/tslint/pull/267#discussion_r23407200","pull_request_url":"https://api.github.com/repos/palantir/tslint/pulls/267","_links":{"self":{"href":"https://api.github.com/repos/palantir/tslint/pulls/comments/23407200"},"html":{"href":"https://github.com/palantir/tslint/pull/267#discussion_r23407200"},"pull_request":{"href":"https://api.github.com/repos/palantir/tslint/pulls/267"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/tslint/pulls/267","id":27873842,"html_url":"https://github.com/palantir/tslint/pull/267","diff_url":"https://github.com/palantir/tslint/pull/267.diff","patch_url":"https://github.com/palantir/tslint/pull/267.patch","issue_url":"https://api.github.com/repos/palantir/tslint/issues/267","number":267,"state":"open","locked":false,"title":"Migrate use strict rule to 1.4","user":{"login":"adidahiya","id":723999,"avatar_url":"https://avatars.githubusercontent.com/u/723999?v=3","gravatar_id":"","url":"https://api.github.com/users/adidahiya","html_url":"https://github.com/adidahiya","followers_url":"https://api.github.com/users/adidahiya/followers","following_url":"https://api.github.com/users/adidahiya/following{/other_user}","gists_url":"https://api.github.com/users/adidahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/adidahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidahiya/subscriptions","organizations_url":"https://api.github.com/users/adidahiya/orgs","repos_url":"https://api.github.com/users/adidahiya/repos","events_url":"https://api.github.com/users/adidahiya/events{/privacy}","received_events_url":"https://api.github.com/users/adidahiya/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-22T20:14:14Z","updated_at":"2015-01-22T20:31:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae70e81d42faf9a5beebc906d312584b0f68cfed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/palantir/tslint/pulls/267/commits","review_comments_url":"https://api.github.com/repos/palantir/tslint/pulls/267/comments","review_comment_url":"https://api.github.com/repos/palantir/tslint/pulls/comments/{number}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/267/comments","statuses_url":"https://api.github.com/repos/palantir/tslint/statuses/f5ee295a609ef4f9676108b7a1ffc00d50d955d4","head":{"label":"adidahiya:1.4-use-strict","ref":"1.4-use-strict","sha":"f5ee295a609ef4f9676108b7a1ffc00d50d955d4","user":{"login":"adidahiya","id":723999,"avatar_url":"https://avatars.githubusercontent.com/u/723999?v=3","gravatar_id":"","url":"https://api.github.com/users/adidahiya","html_url":"https://github.com/adidahiya","followers_url":"https://api.github.com/users/adidahiya/followers","following_url":"https://api.github.com/users/adidahiya/following{/other_user}","gists_url":"https://api.github.com/users/adidahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/adidahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidahiya/subscriptions","organizations_url":"https://api.github.com/users/adidahiya/orgs","repos_url":"https://api.github.com/users/adidahiya/repos","events_url":"https://api.github.com/users/adidahiya/events{/privacy}","received_events_url":"https://api.github.com/users/adidahiya/received_events","type":"User","site_admin":false},"repo":{"id":29617261,"name":"tslint","full_name":"adidahiya/tslint","owner":{"login":"adidahiya","id":723999,"avatar_url":"https://avatars.githubusercontent.com/u/723999?v=3","gravatar_id":"","url":"https://api.github.com/users/adidahiya","html_url":"https://github.com/adidahiya","followers_url":"https://api.github.com/users/adidahiya/followers","following_url":"https://api.github.com/users/adidahiya/following{/other_user}","gists_url":"https://api.github.com/users/adidahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/adidahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidahiya/subscriptions","organizations_url":"https://api.github.com/users/adidahiya/orgs","repos_url":"https://api.github.com/users/adidahiya/repos","events_url":"https://api.github.com/users/adidahiya/events{/privacy}","received_events_url":"https://api.github.com/users/adidahiya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adidahiya/tslint","description":"A linter for the TypeScript language.","fork":true,"url":"https://api.github.com/repos/adidahiya/tslint","forks_url":"https://api.github.com/repos/adidahiya/tslint/forks","keys_url":"https://api.github.com/repos/adidahiya/tslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adidahiya/tslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adidahiya/tslint/teams","hooks_url":"https://api.github.com/repos/adidahiya/tslint/hooks","issue_events_url":"https://api.github.com/repos/adidahiya/tslint/issues/events{/number}","events_url":"https://api.github.com/repos/adidahiya/tslint/events","assignees_url":"https://api.github.com/repos/adidahiya/tslint/assignees{/user}","branches_url":"https://api.github.com/repos/adidahiya/tslint/branches{/branch}","tags_url":"https://api.github.com/repos/adidahiya/tslint/tags","blobs_url":"https://api.github.com/repos/adidahiya/tslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adidahiya/tslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adidahiya/tslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/adidahiya/tslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adidahiya/tslint/statuses/{sha}","languages_url":"https://api.github.com/repos/adidahiya/tslint/languages","stargazers_url":"https://api.github.com/repos/adidahiya/tslint/stargazers","contributors_url":"https://api.github.com/repos/adidahiya/tslint/contributors","subscribers_url":"https://api.github.com/repos/adidahiya/tslint/subscribers","subscription_url":"https://api.github.com/repos/adidahiya/tslint/subscription","commits_url":"https://api.github.com/repos/adidahiya/tslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/adidahiya/tslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/adidahiya/tslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/adidahiya/tslint/issues/comments/{number}","contents_url":"https://api.github.com/repos/adidahiya/tslint/contents/{+path}","compare_url":"https://api.github.com/repos/adidahiya/tslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adidahiya/tslint/merges","archive_url":"https://api.github.com/repos/adidahiya/tslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adidahiya/tslint/downloads","issues_url":"https://api.github.com/repos/adidahiya/tslint/issues{/number}","pulls_url":"https://api.github.com/repos/adidahiya/tslint/pulls{/number}","milestones_url":"https://api.github.com/repos/adidahiya/tslint/milestones{/number}","notifications_url":"https://api.github.com/repos/adidahiya/tslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adidahiya/tslint/labels{/name}","releases_url":"https://api.github.com/repos/adidahiya/tslint/releases{/id}","created_at":"2015-01-21T21:34:48Z","updated_at":"2015-01-21T21:34:49Z","pushed_at":"2015-01-22T20:27:00Z","git_url":"git://github.com/adidahiya/tslint.git","ssh_url":"git@github.com:adidahiya/tslint.git","clone_url":"https://github.com/adidahiya/tslint.git","svn_url":"https://github.com/adidahiya/tslint","homepage":null,"size":8310,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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:1.4","ref":"1.4","sha":"03c41aa90d308589d5b9838c5af7d08d196659c9","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":"A 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}","created_at":"2013-07-25T22:19:18Z","updated_at":"2015-01-21T19:44:59Z","pushed_at":"2015-01-22T20:04:20Z","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":null,"size":10580,"stargazers_count":183,"watchers_count":183,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"open_issues_count":44,"forks":46,"open_issues":44,"watchers":183,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/tslint/pulls/267"},"html":{"href":"https://github.com/palantir/tslint/pull/267"},"issue":{"href":"https://api.github.com/repos/palantir/tslint/issues/267"},"comments":{"href":"https://api.github.com/repos/palantir/tslint/issues/267/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/tslint/pulls/267/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/tslint/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/palantir/tslint/pulls/267/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/tslint/statuses/f5ee295a609ef4f9676108b7a1ffc00d50d955d4"}}}}