{"action":"created","comment":{"url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/comments/220955311","pull_request_review_id":159486415,"id":220955311,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDk1NTMxMQ==","diff_hunk":"@@ -31,7 +21,10 @@ module.exports = context => {\n     }\n   }\n   return {\n-    Literal: validateValue,\n-    StringLiteralTypeAnnotation: validateValue\n+    \"Literal[value='%future added value']\": validateValue,\n+\n+    // StringLiteralTypeAnnotations that are not children of a default case\n+    [':not(SwitchCase[test=null] StringLiteralTypeAnnotation)' +","path":"src/rule-no-future-added-value.js","position":26,"original_position":26,"commit_id":"d7913259e1b8cf87cd2826436395ff91f34f3a8a","original_commit_id":"d7913259e1b8cf87cd2826436395ff91f34f3a8a","user":{"login":"aabmass","id":1510004,"node_id":"MDQ6VXNlcjE1MTAwMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1510004?v=4","gravatar_id":"","url":"https://api.github.com/users/aabmass","html_url":"https://github.com/aabmass","followers_url":"https://api.github.com/users/aabmass/followers","following_url":"https://api.github.com/users/aabmass/following{/other_user}","gists_url":"https://api.github.com/users/aabmass/gists{/gist_id}","starred_url":"https://api.github.com/users/aabmass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabmass/subscriptions","organizations_url":"https://api.github.com/users/aabmass/orgs","repos_url":"https://api.github.com/users/aabmass/repos","events_url":"https://api.github.com/users/aabmass/events{/privacy}","received_events_url":"https://api.github.com/users/aabmass/received_events","type":"User","site_admin":false},"body":"Ya it could be removed as well I think!\r\n\r\nOnly thing is I'm not sure about the performance of the second selector (in a huge repo), but the only other way to check for the parent being a default case is `context.getAncestors()`","created_at":"2018-09-27T14:50:04Z","updated_at":"2018-09-27T14:50:04Z","html_url":"https://github.com/relayjs/eslint-plugin-relay/pull/45#discussion_r220955311","pull_request_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/comments/220955311"},"html":{"href":"https://github.com/relayjs/eslint-plugin-relay/pull/45#discussion_r220955311"},"pull_request":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45"}},"in_reply_to_id":220383395},"pull_request":{"url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45","id":218031231,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MDMxMjMx","html_url":"https://github.com/relayjs/eslint-plugin-relay/pull/45","diff_url":"https://github.com/relayjs/eslint-plugin-relay/pull/45.diff","patch_url":"https://github.com/relayjs/eslint-plugin-relay/pull/45.patch","issue_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/45","number":45,"state":"closed","locked":false,"title":"Allow future added value within default case cast","user":{"login":"aabmass","id":1510004,"node_id":"MDQ6VXNlcjE1MTAwMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1510004?v=4","gravatar_id":"","url":"https://api.github.com/users/aabmass","html_url":"https://github.com/aabmass","followers_url":"https://api.github.com/users/aabmass/followers","following_url":"https://api.github.com/users/aabmass/following{/other_user}","gists_url":"https://api.github.com/users/aabmass/gists{/gist_id}","starred_url":"https://api.github.com/users/aabmass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabmass/subscriptions","organizations_url":"https://api.github.com/users/aabmass/orgs","repos_url":"https://api.github.com/users/aabmass/repos","events_url":"https://api.github.com/users/aabmass/events{/privacy}","received_events_url":"https://api.github.com/users/aabmass/received_events","type":"User","site_admin":false},"body":"Allow using `%future added value` within a cast in the default case of a switch statement. Use this to get an exhaustive switch case in flow while also requiring an explicit default value:\r\n\r\n```js\r\n// type SomeRelayEnum = 'FOO' | 'BAR' | '%future added value';\r\nfunction test(foo: SomeRelayEnum): string {\r\n  switch(foo) {\r\n    case 'FOO':\r\n      return 'foo';\r\n    case 'BAR':\r\n      return 'bar';\r\n    default:\r\n      (foo: '%future added value');\r\n      return 'default';\r\n  }\r\n}\r\n```\r\n\r\n[Try Flow](https://flow.org/try/#0C4TwDgpgBAyg9gWwgJQgGwIYgKIDsCuCUAvFAOQBiA8lWVAD7kBCAgsnY2QKQBm+w+AE7QMAE1ERRUAG4Y0+CGQDcAKBV9cAY2ABLOLijAIAZ2AAKHnDgAuWIhToseQgEpbpwTtwBzKAG8VKChjAHcdYE0ACwsrF39AoKhNDGNoShoyawTEqGEBQQMySzhlbKSUtNZ2LJygvKFCgCMMQVKciR4MfDRgGtqYm3JefiERcUkZOQUyF1Va3Ih8wo6unraoAF8VDaA)\r\n\r\nAdded test cases, ran `yarn test`, ran `yarn run prettier`","created_at":"2018-09-25T15:48:43Z","updated_at":"2018-09-27T14:50:04Z","closed_at":"2018-09-27T01:44:31Z","merged_at":"2018-09-27T01:44:31Z","merge_commit_sha":"9671d56285761a4c415d58bd45e150ed6435c26b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":618076582,"node_id":"MDU6TGFiZWw2MTgwNzY1ODI=","url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45/commits","review_comments_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45/comments","review_comment_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/45/comments","statuses_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/statuses/d7913259e1b8cf87cd2826436395ff91f34f3a8a","head":{"label":"aabmass:nofuture-default","ref":"nofuture-default","sha":"d7913259e1b8cf87cd2826436395ff91f34f3a8a","user":{"login":"aabmass","id":1510004,"node_id":"MDQ6VXNlcjE1MTAwMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1510004?v=4","gravatar_id":"","url":"https://api.github.com/users/aabmass","html_url":"https://github.com/aabmass","followers_url":"https://api.github.com/users/aabmass/followers","following_url":"https://api.github.com/users/aabmass/following{/other_user}","gists_url":"https://api.github.com/users/aabmass/gists{/gist_id}","starred_url":"https://api.github.com/users/aabmass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabmass/subscriptions","organizations_url":"https://api.github.com/users/aabmass/orgs","repos_url":"https://api.github.com/users/aabmass/repos","events_url":"https://api.github.com/users/aabmass/events{/privacy}","received_events_url":"https://api.github.com/users/aabmass/received_events","type":"User","site_admin":false},"repo":{"id":150287280,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAyODcyODA=","name":"eslint-plugin-relay","full_name":"aabmass/eslint-plugin-relay","private":false,"owner":{"login":"aabmass","id":1510004,"node_id":"MDQ6VXNlcjE1MTAwMDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1510004?v=4","gravatar_id":"","url":"https://api.github.com/users/aabmass","html_url":"https://github.com/aabmass","followers_url":"https://api.github.com/users/aabmass/followers","following_url":"https://api.github.com/users/aabmass/following{/other_user}","gists_url":"https://api.github.com/users/aabmass/gists{/gist_id}","starred_url":"https://api.github.com/users/aabmass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabmass/subscriptions","organizations_url":"https://api.github.com/users/aabmass/orgs","repos_url":"https://api.github.com/users/aabmass/repos","events_url":"https://api.github.com/users/aabmass/events{/privacy}","received_events_url":"https://api.github.com/users/aabmass/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aabmass/eslint-plugin-relay","description":"A plugin for the code linter ESLint to lint specific details about Relay.","fork":true,"url":"https://api.github.com/repos/aabmass/eslint-plugin-relay","forks_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/forks","keys_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/teams","hooks_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/hooks","issue_events_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/issues/events{/number}","events_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/events","assignees_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/assignees{/user}","branches_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/branches{/branch}","tags_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/tags","blobs_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/statuses/{sha}","languages_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/languages","stargazers_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/stargazers","contributors_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/contributors","subscribers_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/subscribers","subscription_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/subscription","commits_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/contents/{+path}","compare_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/merges","archive_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/downloads","issues_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/issues{/number}","pulls_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/pulls{/number}","milestones_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/milestones{/number}","notifications_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/labels{/name}","releases_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/releases{/id}","deployments_url":"https://api.github.com/repos/aabmass/eslint-plugin-relay/deployments","created_at":"2018-09-25T15:22:26Z","updated_at":"2018-09-25T15:22:28Z","pushed_at":"2018-09-25T15:35:02Z","git_url":"git://github.com/aabmass/eslint-plugin-relay.git","ssh_url":"git@github.com:aabmass/eslint-plugin-relay.git","clone_url":"https://github.com/aabmass/eslint-plugin-relay.git","svn_url":"https://github.com/aabmass/eslint-plugin-relay","homepage":null,"size":121,"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":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"relayjs:master","ref":"master","sha":"0d52bbf03596de8233e80c911bb15090469b1712","user":{"login":"relayjs","id":13752251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNzUyMjUx","avatar_url":"https://avatars3.githubusercontent.com/u/13752251?v=4","gravatar_id":"","url":"https://api.github.com/users/relayjs","html_url":"https://github.com/relayjs","followers_url":"https://api.github.com/users/relayjs/followers","following_url":"https://api.github.com/users/relayjs/following{/other_user}","gists_url":"https://api.github.com/users/relayjs/gists{/gist_id}","starred_url":"https://api.github.com/users/relayjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relayjs/subscriptions","organizations_url":"https://api.github.com/users/relayjs/orgs","repos_url":"https://api.github.com/users/relayjs/repos","events_url":"https://api.github.com/users/relayjs/events{/privacy}","received_events_url":"https://api.github.com/users/relayjs/received_events","type":"Organization","site_admin":false},"repo":{"id":93126404,"node_id":"MDEwOlJlcG9zaXRvcnk5MzEyNjQwNA==","name":"eslint-plugin-relay","full_name":"relayjs/eslint-plugin-relay","private":false,"owner":{"login":"relayjs","id":13752251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNzUyMjUx","avatar_url":"https://avatars3.githubusercontent.com/u/13752251?v=4","gravatar_id":"","url":"https://api.github.com/users/relayjs","html_url":"https://github.com/relayjs","followers_url":"https://api.github.com/users/relayjs/followers","following_url":"https://api.github.com/users/relayjs/following{/other_user}","gists_url":"https://api.github.com/users/relayjs/gists{/gist_id}","starred_url":"https://api.github.com/users/relayjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relayjs/subscriptions","organizations_url":"https://api.github.com/users/relayjs/orgs","repos_url":"https://api.github.com/users/relayjs/repos","events_url":"https://api.github.com/users/relayjs/events{/privacy}","received_events_url":"https://api.github.com/users/relayjs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/relayjs/eslint-plugin-relay","description":"A plugin for the code linter ESLint to lint specific details about Relay.","fork":false,"url":"https://api.github.com/repos/relayjs/eslint-plugin-relay","forks_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/forks","keys_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/teams","hooks_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/hooks","issue_events_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/events{/number}","events_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/events","assignees_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/assignees{/user}","branches_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/branches{/branch}","tags_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/tags","blobs_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/git/refs{/sha}","trees_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/statuses/{sha}","languages_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/languages","stargazers_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/stargazers","contributors_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/contributors","subscribers_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/subscribers","subscription_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/subscription","commits_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/commits{/sha}","git_commits_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/git/commits{/sha}","comments_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/comments{/number}","issue_comment_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/comments{/number}","contents_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/contents/{+path}","compare_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/merges","archive_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/downloads","issues_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues{/number}","pulls_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls{/number}","milestones_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/milestones{/number}","notifications_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/labels{/name}","releases_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/releases{/id}","deployments_url":"https://api.github.com/repos/relayjs/eslint-plugin-relay/deployments","created_at":"2017-06-02T04:16:51Z","updated_at":"2018-09-27T01:44:33Z","pushed_at":"2018-09-27T01:44:32Z","git_url":"git://github.com/relayjs/eslint-plugin-relay.git","ssh_url":"git@github.com:relayjs/eslint-plugin-relay.git","clone_url":"https://github.com/relayjs/eslint-plugin-relay.git","svn_url":"https://github.com/relayjs/eslint-plugin-relay","homepage":null,"size":121,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":14,"open_issues":4,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45"},"html":{"href":"https://github.com/relayjs/eslint-plugin-relay/pull/45"},"issue":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/45"},"comments":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/relayjs/eslint-plugin-relay/statuses/d7913259e1b8cf87cd2826436395ff91f34f3a8a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aabmass"}}