{"action":"created","comment":{"url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/comments/95056817","pull_request_review_id":15603814,"id":95056817,"diff_hunk":"@@ -0,0 +1,84 @@\n+/**\n+ * @fileoverview Rule to disallow anonymous default exports.\n+ * @author Duncan Beevers\n+ */\n+\n+const defs = {\n+  ArrayExpression: {\n+    option: 'allowArray',\n+    message: 'an array',\n+  },\n+  ArrowFunctionExpression: {\n+    option: 'allowArrowFunction',\n+    message: 'an arrow function',\n+  },\n+  ClassDeclaration: {\n+    option: 'allowAnonymousClass',\n+    message: 'an anonymous class',\n+    forbid: (node) => !node.declaration.id,\n+  },\n+  FunctionDeclaration: {\n+    option: 'allowAnonymousFunction',\n+    message: 'an anonymous function',\n+    forbid: (node) => !node.declaration.id,\n+  },\n+  Literal: {\n+    option: 'allowLiteral',\n+    message: 'a literal',\n+  },\n+  ObjectExpression: {\n+    option: 'allowObject',\n+    message: 'an object expression',\n+  },\n+}\n+\n+const defaultOptions = Object.keys(defs).\n+  map((key) => defs[key]).\n+  reduce((acc, def) => {\n+    acc[def.options] = false\n+\n+    return acc\n+  })\n+\n+const schemaProperties = Object.keys(defs).\n+  map((key) => defs[key]).\n+  reduce((acc, def) => {\n+    acc[def.option] = {\n+      description: 'If `false`, will not report default export of ' + def.message,","path":"src/rules/no-anonymous-default-export.js","position":47,"original_position":47,"commit_id":"2a12e671d8d51fbcb4bf3af03b3c8a2e9033a6b4","original_commit_id":"2a12e671d8d51fbcb4bf3af03b3c8a2e9033a6b4","user":{"login":"jfmengels","id":3869412,"avatar_url":"https://avatars.githubusercontent.com/u/3869412?v=3","gravatar_id":"","url":"https://api.github.com/users/jfmengels","html_url":"https://github.com/jfmengels","followers_url":"https://api.github.com/users/jfmengels/followers","following_url":"https://api.github.com/users/jfmengels/following{/other_user}","gists_url":"https://api.github.com/users/jfmengels/gists{/gist_id}","starred_url":"https://api.github.com/users/jfmengels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfmengels/subscriptions","organizations_url":"https://api.github.com/users/jfmengels/orgs","repos_url":"https://api.github.com/users/jfmengels/repos","events_url":"https://api.github.com/users/jfmengels/events{/privacy}","received_events_url":"https://api.github.com/users/jfmengels/received_events","type":"User","site_admin":false},"body":"This sounds like the opposite of what the name suggests.\r\nFrom what I understand, if `allowLiteral` is set to true, then Literals will be reported. :thinking: \r\n\r\nThis should be reversed and the default value should be false.","created_at":"2017-01-07T11:27:51Z","updated_at":"2017-01-07T11:29:52Z","html_url":"https://github.com/benmosher/eslint-plugin-import/pull/712#discussion_r95056817","pull_request_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712","_links":{"self":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/comments/95056817"},"html":{"href":"https://github.com/benmosher/eslint-plugin-import/pull/712#discussion_r95056817"},"pull_request":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712"}}},"pull_request":{"url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712","id":100348289,"html_url":"https://github.com/benmosher/eslint-plugin-import/pull/712","diff_url":"https://github.com/benmosher/eslint-plugin-import/pull/712.diff","patch_url":"https://github.com/benmosher/eslint-plugin-import/pull/712.patch","issue_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/712","number":712,"state":"open","locked":false,"title":"Add `no-anonymous-default-export` rule","user":{"login":"duncanbeevers","id":7367,"avatar_url":"https://avatars.githubusercontent.com/u/7367?v=3","gravatar_id":"","url":"https://api.github.com/users/duncanbeevers","html_url":"https://github.com/duncanbeevers","followers_url":"https://api.github.com/users/duncanbeevers/followers","following_url":"https://api.github.com/users/duncanbeevers/following{/other_user}","gists_url":"https://api.github.com/users/duncanbeevers/gists{/gist_id}","starred_url":"https://api.github.com/users/duncanbeevers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duncanbeevers/subscriptions","organizations_url":"https://api.github.com/users/duncanbeevers/orgs","repos_url":"https://api.github.com/users/duncanbeevers/repos","events_url":"https://api.github.com/users/duncanbeevers/events{/privacy}","received_events_url":"https://api.github.com/users/duncanbeevers/received_events","type":"User","site_admin":false},"body":"Forbids exporting anonymous functions, literals, class expressions, or arrow functions as module default.\r\n\r\nThis is intended to improve the grepability of codebases by encouraging the re-use of identifiers at their declaration site and at their import sites.\r\n\r\n\r\n## Rule Details\r\n\r\n### Fail\r\n```js\r\nexport default 123\r\n\r\nexport default {}\r\n\r\nexport default function () {}\r\n\r\nexport default () => {}\r\n\r\nexport default class {}\r\n```\r\n\r\n### Pass\r\n```js\r\nconst foo = 123\r\nexport default foo\r\n\r\nexport default function foo() {}\r\n\r\n/*eslint no-anonymous-default-export: [2, \"allow-literal\"]*/\r\nexport default 123\r\n\r\n/*eslint no-anonymous-default-export: [2, \"object-expression\"]*/\r\nexport default {}\r\n\r\n/*eslint no-anonymous-default-export: [2, \"allow-anonymous-function-declaration\"]*/\r\nexport default function () {}\r\n\r\n/*eslint no-anonymous-default-export: [2, \"allow-arrow-function-expression\"]*/\r\nexport default () => {}\r\n\r\n/*eslint no-anonymous-default-export: [2, \"allow-anonymous-class-declaration\"]*/\r\nexport default class {}\r\n```\r\n","created_at":"2017-01-05T19:25:36Z","updated_at":"2017-01-07T11:29:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1cb074d8baf52d9a9aaab412d87a9618e0ccf30","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712/commits","review_comments_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712/comments","review_comment_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/comments{/number}","comments_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/712/comments","statuses_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/statuses/2a12e671d8d51fbcb4bf3af03b3c8a2e9033a6b4","head":{"label":"duncanbeevers:no-anonymous-default-export","ref":"no-anonymous-default-export","sha":"2a12e671d8d51fbcb4bf3af03b3c8a2e9033a6b4","user":{"login":"duncanbeevers","id":7367,"avatar_url":"https://avatars.githubusercontent.com/u/7367?v=3","gravatar_id":"","url":"https://api.github.com/users/duncanbeevers","html_url":"https://github.com/duncanbeevers","followers_url":"https://api.github.com/users/duncanbeevers/followers","following_url":"https://api.github.com/users/duncanbeevers/following{/other_user}","gists_url":"https://api.github.com/users/duncanbeevers/gists{/gist_id}","starred_url":"https://api.github.com/users/duncanbeevers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duncanbeevers/subscriptions","organizations_url":"https://api.github.com/users/duncanbeevers/orgs","repos_url":"https://api.github.com/users/duncanbeevers/repos","events_url":"https://api.github.com/users/duncanbeevers/events{/privacy}","received_events_url":"https://api.github.com/users/duncanbeevers/received_events","type":"User","site_admin":false},"repo":{"id":78141395,"name":"eslint-plugin-import","full_name":"duncanbeevers/eslint-plugin-import","owner":{"login":"duncanbeevers","id":7367,"avatar_url":"https://avatars.githubusercontent.com/u/7367?v=3","gravatar_id":"","url":"https://api.github.com/users/duncanbeevers","html_url":"https://github.com/duncanbeevers","followers_url":"https://api.github.com/users/duncanbeevers/followers","following_url":"https://api.github.com/users/duncanbeevers/following{/other_user}","gists_url":"https://api.github.com/users/duncanbeevers/gists{/gist_id}","starred_url":"https://api.github.com/users/duncanbeevers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duncanbeevers/subscriptions","organizations_url":"https://api.github.com/users/duncanbeevers/orgs","repos_url":"https://api.github.com/users/duncanbeevers/repos","events_url":"https://api.github.com/users/duncanbeevers/events{/privacy}","received_events_url":"https://api.github.com/users/duncanbeevers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/duncanbeevers/eslint-plugin-import","description":"ESLint plugin with rules that help validate proper imports.","fork":true,"url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import","forks_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/forks","keys_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/teams","hooks_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/hooks","issue_events_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/issues/events{/number}","events_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/events","assignees_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/assignees{/user}","branches_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/branches{/branch}","tags_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/tags","blobs_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/statuses/{sha}","languages_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/languages","stargazers_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/stargazers","contributors_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/contributors","subscribers_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/subscribers","subscription_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/subscription","commits_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/contents/{+path}","compare_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/merges","archive_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/downloads","issues_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/issues{/number}","pulls_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/pulls{/number}","milestones_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/milestones{/number}","notifications_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/labels{/name}","releases_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/releases{/id}","deployments_url":"https://api.github.com/repos/duncanbeevers/eslint-plugin-import/deployments","created_at":"2017-01-05T19:22:49Z","updated_at":"2017-01-05T19:22:52Z","pushed_at":"2017-01-07T06:54:38Z","git_url":"git://github.com/duncanbeevers/eslint-plugin-import.git","ssh_url":"git@github.com:duncanbeevers/eslint-plugin-import.git","clone_url":"https://github.com/duncanbeevers/eslint-plugin-import.git","svn_url":"https://github.com/duncanbeevers/eslint-plugin-import","homepage":null,"size":1076,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"benmosher:master","ref":"master","sha":"c9757426e125e08ffe38ba28e298d8f5c5eaa0c5","user":{"login":"benmosher","id":3709196,"avatar_url":"https://avatars.githubusercontent.com/u/3709196?v=3","gravatar_id":"","url":"https://api.github.com/users/benmosher","html_url":"https://github.com/benmosher","followers_url":"https://api.github.com/users/benmosher/followers","following_url":"https://api.github.com/users/benmosher/following{/other_user}","gists_url":"https://api.github.com/users/benmosher/gists{/gist_id}","starred_url":"https://api.github.com/users/benmosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmosher/subscriptions","organizations_url":"https://api.github.com/users/benmosher/orgs","repos_url":"https://api.github.com/users/benmosher/repos","events_url":"https://api.github.com/users/benmosher/events{/privacy}","received_events_url":"https://api.github.com/users/benmosher/received_events","type":"User","site_admin":false},"repo":{"id":32238354,"name":"eslint-plugin-import","full_name":"benmosher/eslint-plugin-import","owner":{"login":"benmosher","id":3709196,"avatar_url":"https://avatars.githubusercontent.com/u/3709196?v=3","gravatar_id":"","url":"https://api.github.com/users/benmosher","html_url":"https://github.com/benmosher","followers_url":"https://api.github.com/users/benmosher/followers","following_url":"https://api.github.com/users/benmosher/following{/other_user}","gists_url":"https://api.github.com/users/benmosher/gists{/gist_id}","starred_url":"https://api.github.com/users/benmosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmosher/subscriptions","organizations_url":"https://api.github.com/users/benmosher/orgs","repos_url":"https://api.github.com/users/benmosher/repos","events_url":"https://api.github.com/users/benmosher/events{/privacy}","received_events_url":"https://api.github.com/users/benmosher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benmosher/eslint-plugin-import","description":"ESLint plugin with rules that help validate proper imports.","fork":false,"url":"https://api.github.com/repos/benmosher/eslint-plugin-import","forks_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/forks","keys_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/teams","hooks_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/hooks","issue_events_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/events{/number}","events_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/events","assignees_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/assignees{/user}","branches_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/branches{/branch}","tags_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/tags","blobs_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/statuses/{sha}","languages_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/languages","stargazers_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/stargazers","contributors_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/contributors","subscribers_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/subscribers","subscription_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/subscription","commits_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/contents/{+path}","compare_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/merges","archive_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/downloads","issues_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues{/number}","pulls_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls{/number}","milestones_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/milestones{/number}","notifications_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/labels{/name}","releases_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/releases{/id}","deployments_url":"https://api.github.com/repos/benmosher/eslint-plugin-import/deployments","created_at":"2015-03-15T00:21:57Z","updated_at":"2017-01-07T08:54:50Z","pushed_at":"2017-01-07T06:54:40Z","git_url":"git://github.com/benmosher/eslint-plugin-import.git","ssh_url":"git@github.com:benmosher/eslint-plugin-import.git","clone_url":"https://github.com/benmosher/eslint-plugin-import.git","svn_url":"https://github.com/benmosher/eslint-plugin-import","homepage":null,"size":1073,"stargazers_count":566,"watchers_count":566,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":114,"forks":149,"open_issues":114,"watchers":566,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712"},"html":{"href":"https://github.com/benmosher/eslint-plugin-import/pull/712"},"issue":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/712"},"comments":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/issues/712/comments"},"review_comments":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712/comments"},"review_comment":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/pulls/712/commits"},"statuses":{"href":"https://api.github.com/repos/benmosher/eslint-plugin-import/statuses/2a12e671d8d51fbcb4bf3af03b3c8a2e9033a6b4"}}}}
{"actor":{"display_login":"jfmengels"}}