{"action":"created","comment":{"url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/comments/240860446","pull_request_review_id":183987123,"id":240860446,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDg2MDQ0Ng==","diff_hunk":"@@ -0,0 +1,234 @@\n+/**\n+ * @fileoverview Requires using either 'T[]' or 'Array' for arrays.\n+ * @author Mackie Underdown\n+ * @author Armano <https://github.com/armano2>\n+ */\n+\"use strict\";\n+\n+const util = require(\"../util\");\n+\n+/**\n+ * Check whatever node can be considered as simple\n+ * @param {ASTNode} node the node to be evaluated.\n+ * @returns {*} true or false\n+ */\n+function isSimpleType(node) {\n+    switch (node.type) {\n+        case \"Identifier\":\n+        case \"TSAnyKeyword\":\n+        case \"TSBooleanKeyword\":\n+        case \"TSNeverKeyword\":\n+        case \"TSNumberKeyword\":\n+        case \"TSObjectKeyword\":\n+        case \"TSStringKeyword\":\n+        case \"TSSymbolKeyword\":\n+        case \"TSUnknownKeyword\":\n+        case \"TSVoidKeyword\":\n+        case \"TSNullKeyword\":\n+        case \"TSArrayType\":\n+        case \"TSUndefinedKeyword\":\n+        case \"TSThisType\":\n+        case \"TSQualifiedName\":\n+            return true;\n+        case \"TSTypeReference\":\n+            if (\n+                node.typeName &&\n+                node.typeName.type === \"Identifier\" &&\n+                node.typeName.name === \"Array\"\n+            ) {\n+                if (!node.typeParameters) {\n+                    return true;\n+                }\n+                if (node.typeParameters.params.length === 1) {\n+                    return isSimpleType(node.typeParameters.params[0]);\n+                }\n+            } else {\n+                if (node.typeParameters) {\n+                    return false;\n+                }\n+                return isSimpleType(node.typeName);\n+            }\n+            return false;\n+        default:\n+            return false;\n+    }\n+}\n+\n+/**\n+ * Check if node needs parentheses\n+ * @param {ASTNode} node the node to be evaluated.\n+ * @returns {*} true or false\n+ */\n+function typeNeedsParentheses(node) {\n+    if (node.type === \"TSTypeReference\") {\n+        switch (node.typeName.type) {\n+            case \"TSUnionType\":\n+            case \"TSFunctionType\":\n+            case \"TSIntersectionType\":\n+            case \"TSTypeOperator\":\n+                return true;\n+            default:\n+                return false;\n+        }\n+    }\n+    return false;\n+}\n+\n+//------------------------------------------------------------------------------\n+// Rule Definition\n+//------------------------------------------------------------------------------\n+\n+module.exports = {\n+    meta: {\n+        docs: {\n+            description: \"Requires using either 'T[]' or 'Array' for arrays\",\n+            extraDescription: [util.tslintRule(\"array-type\")],\n+            category: \"TypeScript\",\n+            url:\n+                \"https://github.com/nzakas/eslint-plugin-typescript/blob/master/docs/rules/array-type.md\",\n+        },\n+        fixable: \"code\",\n+        messages: {\n+            errorStringGeneric:\n+                \"Array type using 'T[]' is forbidden. Use 'Array<T>' instead.\",\n+            errorStringGenericSimple:\n+                \"Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>' instead.\",\n+            errorStringArray:\n+                \"Array type using 'Array<T>' is forbidden. Use 'T[]' instead.\",\n+            errorStringArraySimple:\n+                \"Array type using 'Array<T>' is forbidden for simple types. Use 'T[]' instead.\",","path":"lib/rules/array-type.js","position":99,"original_position":99,"commit_id":"e9737841940dfd3ccf642327cb1eb2a7b524226f","original_commit_id":"e9737841940dfd3ccf642327cb1eb2a7b524226f","user":{"login":"bradzacher","id":7462525,"node_id":"MDQ6VXNlcjc0NjI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7462525?v=4","gravatar_id":"","url":"https://api.github.com/users/bradzacher","html_url":"https://github.com/bradzacher","followers_url":"https://api.github.com/users/bradzacher/followers","following_url":"https://api.github.com/users/bradzacher/following{/other_user}","gists_url":"https://api.github.com/users/bradzacher/gists{/gist_id}","starred_url":"https://api.github.com/users/bradzacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradzacher/subscriptions","organizations_url":"https://api.github.com/users/bradzacher/orgs","repos_url":"https://api.github.com/users/bradzacher/repos","events_url":"https://api.github.com/users/bradzacher/events{/privacy}","received_events_url":"https://api.github.com/users/bradzacher/received_events","type":"User","site_admin":false},"body":"To make the errors nicer, could you please make use of the `{{placeholders}}`?","created_at":"2018-12-12T02:06:14Z","updated_at":"2018-12-12T02:21:08Z","html_url":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211#discussion_r240860446","pull_request_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/comments/240860446"},"html":{"href":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211#discussion_r240860446"},"pull_request":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211","id":237539255,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3NTM5MjU1","html_url":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211","diff_url":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211.diff","patch_url":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211.patch","issue_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/211","number":211,"state":"open","locked":false,"title":"Add rule array-type","user":{"login":"armano2","id":625469,"node_id":"MDQ6VXNlcjYyNTQ2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/625469?v=4","gravatar_id":"","url":"https://api.github.com/users/armano2","html_url":"https://github.com/armano2","followers_url":"https://api.github.com/users/armano2/followers","following_url":"https://api.github.com/users/armano2/following{/other_user}","gists_url":"https://api.github.com/users/armano2/gists{/gist_id}","starred_url":"https://api.github.com/users/armano2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armano2/subscriptions","organizations_url":"https://api.github.com/users/armano2/orgs","repos_url":"https://api.github.com/users/armano2/repos","events_url":"https://api.github.com/users/armano2/events{/privacy}","received_events_url":"https://api.github.com/users/armano2/received_events","type":"User","site_admin":false},"body":"This is continuation of #117\r\n\r\n**TODO**:\r\n- [x] ~~Add documentation~~\r\n- [x] ~~Fix nested `arrays`~~","created_at":"2018-12-11T03:27:07Z","updated_at":"2018-12-12T02:21:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2834a68b5460ac95d86c25375ce1e3ff0c8091e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211/commits","review_comments_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211/comments","review_comment_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/211/comments","statuses_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/statuses/e9737841940dfd3ccf642327cb1eb2a7b524226f","head":{"label":"armano2:array-type","ref":"array-type","sha":"e9737841940dfd3ccf642327cb1eb2a7b524226f","user":{"login":"armano2","id":625469,"node_id":"MDQ6VXNlcjYyNTQ2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/625469?v=4","gravatar_id":"","url":"https://api.github.com/users/armano2","html_url":"https://github.com/armano2","followers_url":"https://api.github.com/users/armano2/followers","following_url":"https://api.github.com/users/armano2/following{/other_user}","gists_url":"https://api.github.com/users/armano2/gists{/gist_id}","starred_url":"https://api.github.com/users/armano2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armano2/subscriptions","organizations_url":"https://api.github.com/users/armano2/orgs","repos_url":"https://api.github.com/users/armano2/repos","events_url":"https://api.github.com/users/armano2/events{/privacy}","received_events_url":"https://api.github.com/users/armano2/received_events","type":"User","site_admin":false},"repo":{"id":157937446,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc5Mzc0NDY=","name":"eslint-plugin-typescript","full_name":"armano2/eslint-plugin-typescript","private":false,"owner":{"login":"armano2","id":625469,"node_id":"MDQ6VXNlcjYyNTQ2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/625469?v=4","gravatar_id":"","url":"https://api.github.com/users/armano2","html_url":"https://github.com/armano2","followers_url":"https://api.github.com/users/armano2/followers","following_url":"https://api.github.com/users/armano2/following{/other_user}","gists_url":"https://api.github.com/users/armano2/gists{/gist_id}","starred_url":"https://api.github.com/users/armano2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armano2/subscriptions","organizations_url":"https://api.github.com/users/armano2/orgs","repos_url":"https://api.github.com/users/armano2/repos","events_url":"https://api.github.com/users/armano2/events{/privacy}","received_events_url":"https://api.github.com/users/armano2/received_events","type":"User","site_admin":false},"html_url":"https://github.com/armano2/eslint-plugin-typescript","description":"TypeScript plugin for ESLint","fork":true,"url":"https://api.github.com/repos/armano2/eslint-plugin-typescript","forks_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/forks","keys_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/teams","hooks_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/hooks","issue_events_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/issues/events{/number}","events_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/events","assignees_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/assignees{/user}","branches_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/branches{/branch}","tags_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/tags","blobs_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/git/refs{/sha}","trees_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/statuses/{sha}","languages_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/languages","stargazers_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/stargazers","contributors_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/contributors","subscribers_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/subscribers","subscription_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/subscription","commits_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/commits{/sha}","git_commits_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/git/commits{/sha}","comments_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/comments{/number}","issue_comment_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/issues/comments{/number}","contents_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/contents/{+path}","compare_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/merges","archive_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/downloads","issues_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/issues{/number}","pulls_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/pulls{/number}","milestones_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/milestones{/number}","notifications_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/labels{/name}","releases_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/releases{/id}","deployments_url":"https://api.github.com/repos/armano2/eslint-plugin-typescript/deployments","created_at":"2018-11-17T00:52:46Z","updated_at":"2018-12-11T07:15:10Z","pushed_at":"2018-12-12T00:31:35Z","git_url":"git://github.com/armano2/eslint-plugin-typescript.git","ssh_url":"git@github.com:armano2/eslint-plugin-typescript.git","clone_url":"https://github.com/armano2/eslint-plugin-typescript.git","svn_url":"https://github.com/armano2/eslint-plugin-typescript","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bradzacher:master","ref":"master","sha":"c40964c3a49352bd8c6bca91315819a31c1ef280","user":{"login":"bradzacher","id":7462525,"node_id":"MDQ6VXNlcjc0NjI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7462525?v=4","gravatar_id":"","url":"https://api.github.com/users/bradzacher","html_url":"https://github.com/bradzacher","followers_url":"https://api.github.com/users/bradzacher/followers","following_url":"https://api.github.com/users/bradzacher/following{/other_user}","gists_url":"https://api.github.com/users/bradzacher/gists{/gist_id}","starred_url":"https://api.github.com/users/bradzacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradzacher/subscriptions","organizations_url":"https://api.github.com/users/bradzacher/orgs","repos_url":"https://api.github.com/users/bradzacher/repos","events_url":"https://api.github.com/users/bradzacher/events{/privacy}","received_events_url":"https://api.github.com/users/bradzacher/received_events","type":"User","site_admin":false},"repo":{"id":66300346,"node_id":"MDEwOlJlcG9zaXRvcnk2NjMwMDM0Ng==","name":"eslint-plugin-typescript","full_name":"bradzacher/eslint-plugin-typescript","private":false,"owner":{"login":"bradzacher","id":7462525,"node_id":"MDQ6VXNlcjc0NjI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7462525?v=4","gravatar_id":"","url":"https://api.github.com/users/bradzacher","html_url":"https://github.com/bradzacher","followers_url":"https://api.github.com/users/bradzacher/followers","following_url":"https://api.github.com/users/bradzacher/following{/other_user}","gists_url":"https://api.github.com/users/bradzacher/gists{/gist_id}","starred_url":"https://api.github.com/users/bradzacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradzacher/subscriptions","organizations_url":"https://api.github.com/users/bradzacher/orgs","repos_url":"https://api.github.com/users/bradzacher/repos","events_url":"https://api.github.com/users/bradzacher/events{/privacy}","received_events_url":"https://api.github.com/users/bradzacher/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bradzacher/eslint-plugin-typescript","description":"TypeScript plugin for ESLint","fork":false,"url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript","forks_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/forks","keys_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/teams","hooks_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/hooks","issue_events_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/events{/number}","events_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/events","assignees_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/assignees{/user}","branches_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/branches{/branch}","tags_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/tags","blobs_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/git/refs{/sha}","trees_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/statuses/{sha}","languages_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/languages","stargazers_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/stargazers","contributors_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/contributors","subscribers_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/subscribers","subscription_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/subscription","commits_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/commits{/sha}","git_commits_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/git/commits{/sha}","comments_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/comments{/number}","issue_comment_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/comments{/number}","contents_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/contents/{+path}","compare_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/merges","archive_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/downloads","issues_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues{/number}","pulls_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls{/number}","milestones_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/milestones{/number}","notifications_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/labels{/name}","releases_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/releases{/id}","deployments_url":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/deployments","created_at":"2016-08-22T19:05:14Z","updated_at":"2018-12-11T13:41:22Z","pushed_at":"2018-12-12T00:31:54Z","git_url":"git://github.com/bradzacher/eslint-plugin-typescript.git","ssh_url":"git@github.com:bradzacher/eslint-plugin-typescript.git","clone_url":"https://github.com/bradzacher/eslint-plugin-typescript.git","svn_url":"https://github.com/bradzacher/eslint-plugin-typescript","homepage":null,"size":427,"stargazers_count":299,"watchers_count":299,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":48,"open_issues":28,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211"},"html":{"href":"https://github.com/bradzacher/eslint-plugin-typescript/pull/211"},"issue":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/211"},"comments":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/bradzacher/eslint-plugin-typescript/statuses/e9737841940dfd3ccf642327cb1eb2a7b524226f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bradzacher"}}