{"action":"created","comment":{"url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/comments/220641967","pull_request_review_id":159095969,"id":220641967,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDY0MTk2Nw==","diff_hunk":"@@ -0,0 +1,57 @@\n+'use strict';\n+\n+const utils = require('../utils');\n+\n+module.exports = {\n+  meta: {\n+    docs: {},\n+    category: '', // fixme: add valid category\n+    schema: {\n+      type: 'array',\n+      items: { type: 'string' },\n+      minItems: 1,\n+      uniqueItems: true,\n+    },\n+  },\n+  create (context) {\n+    const options = new Set(context.options || []);\n+\n+    // fixme: add JSDoc\n+    function isValidCategory (node) {\n+      return Boolean(\n+        node &&\n+        node.type === 'Literal' &&\n+        typeof node.value === 'string' &&\n+        options.has(node.value)\n+      );\n+    }\n+\n+    return {\n+      Program (node) {\n+        const info = utils.getRuleInfo(node);\n+        if (!info) {\n+          return;\n+        }\n+\n+        const metaNode = info.meta;\n+        const docsPropNode =\n+          metaNode &&\n+          metaNode.properties &&\n+          metaNode.properties.find(p => p.type === 'Property' && utils.getKeyName(p) === 'docs');\n+        const categoryPropNode =\n+          docsPropNode &&\n+          docsPropNode.value.properties &&\n+          docsPropNode.value.properties.find(p => p.type === 'Property' && utils.getKeyName(p) === 'category');\n+\n+        if (isValidCategory(categoryPropNode && categoryPropNode.value)) {\n+          return;\n+        }\n+\n+        context.report({\n+          node: categoryPropNode.value,\n+          message: 'Not a valid category.',","path":"lib/rules/require-valid-categories.js","position":52,"original_position":52,"commit_id":"02d05de4175c4115b18299e53ae08cdd74a0c034","original_commit_id":"02d05de4175c4115b18299e53ae08cdd74a0c034","user":{"login":"not-an-aardvark","id":11638619,"node_id":"MDQ6VXNlcjExNjM4NjE5","avatar_url":"https://avatars2.githubusercontent.com/u/11638619?v=4","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"body":"Agreed -- maybe add the names of the valid categories? For example: `Category should be one of 'Foo', 'Bar', or 'Baz'.`","created_at":"2018-09-26T16:49:30Z","updated_at":"2018-09-26T16:50:06Z","html_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63#discussion_r220641967","pull_request_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/comments/220641967"},"html":{"href":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63#discussion_r220641967"},"pull_request":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63"}},"in_reply_to_id":219974108},"pull_request":{"url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63","id":217774086,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3Nzc0MDg2","html_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63","diff_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63.diff","patch_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63.patch","issue_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/63","number":63,"state":"open","locked":false,"title":"WIP: Add require-valid-categories rule","user":{"login":"macklinu","id":2344137,"node_id":"MDQ6VXNlcjIzNDQxMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/2344137?v=4","gravatar_id":"","url":"https://api.github.com/users/macklinu","html_url":"https://github.com/macklinu","followers_url":"https://api.github.com/users/macklinu/followers","following_url":"https://api.github.com/users/macklinu/following{/other_user}","gists_url":"https://api.github.com/users/macklinu/gists{/gist_id}","starred_url":"https://api.github.com/users/macklinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macklinu/subscriptions","organizations_url":"https://api.github.com/users/macklinu/orgs","repos_url":"https://api.github.com/users/macklinu/repos","events_url":"https://api.github.com/users/macklinu/events{/privacy}","received_events_url":"https://api.github.com/users/macklinu/received_events","type":"User","site_admin":false},"body":"See #60 \r\n\r\nThis is a start at implementing the rule in #60. Still a WIP, but wanted to open the PR to start a discussion and also let you know that someone is working on it. 🎉 \r\n\r\nTODO: \r\n\r\n- [ ] add rule category\r\n- [ ] add proper JSDoc\r\n- [ ] add more test cases (old rule format, new rule format, empty category option, no category option, invalid category option, like numbers)\r\n- [ ] add `docs/rules/require-valid-categories.md`","created_at":"2018-09-24T20:12:49Z","updated_at":"2018-09-26T16:50:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22295a7fa4bfa14a3d21ad6fec1f0899d89d6829","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63/commits","review_comments_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63/comments","review_comment_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/63/comments","statuses_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/statuses/02d05de4175c4115b18299e53ae08cdd74a0c034","head":{"label":"macklinu:rule/require-valid-categories","ref":"rule/require-valid-categories","sha":"02d05de4175c4115b18299e53ae08cdd74a0c034","user":{"login":"macklinu","id":2344137,"node_id":"MDQ6VXNlcjIzNDQxMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/2344137?v=4","gravatar_id":"","url":"https://api.github.com/users/macklinu","html_url":"https://github.com/macklinu","followers_url":"https://api.github.com/users/macklinu/followers","following_url":"https://api.github.com/users/macklinu/following{/other_user}","gists_url":"https://api.github.com/users/macklinu/gists{/gist_id}","starred_url":"https://api.github.com/users/macklinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macklinu/subscriptions","organizations_url":"https://api.github.com/users/macklinu/orgs","repos_url":"https://api.github.com/users/macklinu/repos","events_url":"https://api.github.com/users/macklinu/events{/privacy}","received_events_url":"https://api.github.com/users/macklinu/received_events","type":"User","site_admin":false},"repo":{"id":135321070,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUzMjEwNzA=","name":"eslint-plugin-eslint-plugin","full_name":"macklinu/eslint-plugin-eslint-plugin","private":false,"owner":{"login":"macklinu","id":2344137,"node_id":"MDQ6VXNlcjIzNDQxMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/2344137?v=4","gravatar_id":"","url":"https://api.github.com/users/macklinu","html_url":"https://github.com/macklinu","followers_url":"https://api.github.com/users/macklinu/followers","following_url":"https://api.github.com/users/macklinu/following{/other_user}","gists_url":"https://api.github.com/users/macklinu/gists{/gist_id}","starred_url":"https://api.github.com/users/macklinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macklinu/subscriptions","organizations_url":"https://api.github.com/users/macklinu/orgs","repos_url":"https://api.github.com/users/macklinu/repos","events_url":"https://api.github.com/users/macklinu/events{/privacy}","received_events_url":"https://api.github.com/users/macklinu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/macklinu/eslint-plugin-eslint-plugin","description":"An ESLint plugin for linting ESLint plugins","fork":true,"url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin","forks_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/forks","keys_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/teams","hooks_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/hooks","issue_events_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/events","assignees_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/tags","blobs_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/languages","stargazers_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/stargazers","contributors_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/contributors","subscribers_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/subscribers","subscription_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/subscription","commits_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/merges","archive_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/downloads","issues_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/labels{/name}","releases_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/macklinu/eslint-plugin-eslint-plugin/deployments","created_at":"2018-05-29T16:04:12Z","updated_at":"2018-05-29T16:06:50Z","pushed_at":"2018-09-24T20:11:36Z","git_url":"git://github.com/macklinu/eslint-plugin-eslint-plugin.git","ssh_url":"git@github.com:macklinu/eslint-plugin-eslint-plugin.git","clone_url":"https://github.com/macklinu/eslint-plugin-eslint-plugin.git","svn_url":"https://github.com/macklinu/eslint-plugin-eslint-plugin","homepage":null,"size":172,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"not-an-aardvark:master","ref":"master","sha":"7df313dd2724df1bb5aac751e2d5ddfdb95f7024","user":{"login":"not-an-aardvark","id":11638619,"node_id":"MDQ6VXNlcjExNjM4NjE5","avatar_url":"https://avatars2.githubusercontent.com/u/11638619?v=4","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"repo":{"id":76387033,"node_id":"MDEwOlJlcG9zaXRvcnk3NjM4NzAzMw==","name":"eslint-plugin-eslint-plugin","full_name":"not-an-aardvark/eslint-plugin-eslint-plugin","private":false,"owner":{"login":"not-an-aardvark","id":11638619,"node_id":"MDQ6VXNlcjExNjM4NjE5","avatar_url":"https://avatars2.githubusercontent.com/u/11638619?v=4","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"html_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin","description":"An ESLint plugin for linting ESLint plugins","fork":false,"url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin","forks_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/forks","keys_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/teams","hooks_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/hooks","issue_events_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/events","assignees_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/tags","blobs_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/languages","stargazers_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/stargazers","contributors_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/contributors","subscribers_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/subscribers","subscription_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/subscription","commits_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/merges","archive_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/downloads","issues_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/labels{/name}","releases_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/deployments","created_at":"2016-12-13T18:30:56Z","updated_at":"2018-09-25T02:30:57Z","pushed_at":"2018-09-24T20:12:50Z","git_url":"git://github.com/not-an-aardvark/eslint-plugin-eslint-plugin.git","ssh_url":"git@github.com:not-an-aardvark/eslint-plugin-eslint-plugin.git","clone_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin.git","svn_url":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin","homepage":null,"size":167,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":9,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63"},"html":{"href":"https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/pull/63"},"issue":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/63"},"comments":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/not-an-aardvark/eslint-plugin-eslint-plugin/statuses/02d05de4175c4115b18299e53ae08cdd74a0c034"}},"author_association":"NONE"}}
{"actor":{"display_login":"not-an-aardvark"}}