{"action":"created","comment":{"url":"https://api.github.com/repos/babel/babel/pulls/comments/73458728","id":73458728,"diff_hunk":"@@ -1,42 +1,50 @@\n module.exports = function(context, opts) {\n-  /* eslint-disable no-var */\n-  var loose = false;\n-  var modules = true;\n-  /* eslint-enable no-var */\n+  const moduleTypes = [\"commonjs\", \"amd\", \"umd\", \"systemjs\"];\n+  let loose = false;\n+  let modules = \"commonjs\";\n+  let spec = false;\n+\n   if (opts !== undefined) {\n     if (opts.loose !== undefined) loose = opts.loose;\n     if (opts.modules !== undefined) modules = opts.modules;\n+    if (opts.spec !== undefined) spec = opts.spec;\n   }\n \n   if (typeof loose !== \"boolean\") throw new Error(\"Preset es2015 'loose' option must be a boolean.\");\n-  if (typeof modules !== \"boolean\") throw new Error(\"Preset es2015 'modules' option must be a boolean.\");\n+  if (modules === true || moduleTypes.indexOf(modules) === -1) {\n+    throw new Error(\"Preset es2015 'modules' option must be 'false' to indicate no modules\\n\" +\n+      \"or a module type which be be one of ['commonjs', 'amd', 'umd', 'systemjs']\");\n+  }\n+  if (typeof spec !== \"boolean\") throw new Error(\"Preset es2015 'spec' option must be a boolean.\");\n \n   return {\n     plugins: [\n-      [require(\"babel-plugin-transform-es2015-template-literals\"), {loose: loose}],\n+      [require(\"babel-plugin-transform-es2015-template-literals\"), { loose, spec }],\n       require(\"babel-plugin-transform-es2015-literals\"),\n       require(\"babel-plugin-transform-es2015-function-name\"),\n-      require(\"babel-plugin-transform-es2015-arrow-functions\"),\n+      [require(\"babel-plugin-transform-es2015-arrow-functions\"), { spec }],\n       require(\"babel-plugin-transform-es2015-block-scoped-functions\"),\n-      [require(\"babel-plugin-transform-es2015-classes\"), {loose: loose}],\n+      [require(\"babel-plugin-transform-es2015-classes\"), { loose }],\n       require(\"babel-plugin-transform-es2015-object-super\"),\n       require(\"babel-plugin-transform-es2015-shorthand-properties\"),\n       require(\"babel-plugin-transform-es2015-duplicate-keys\"),\n-      [require(\"babel-plugin-transform-es2015-computed-properties\"), {loose: loose}],\n-      [require(\"babel-plugin-transform-es2015-for-of\"), {loose: loose}],\n+      [require(\"babel-plugin-transform-es2015-computed-properties\"), { loose }],\n+      [require(\"babel-plugin-transform-es2015-for-of\"), { loose }],\n       require(\"babel-plugin-transform-es2015-sticky-regex\"),\n       require(\"babel-plugin-transform-es2015-unicode-regex\"),\n       require(\"babel-plugin-check-es2015-constants\"),\n-      [require(\"babel-plugin-transform-es2015-spread\"), {loose: loose}],\n+      [require(\"babel-plugin-transform-es2015-spread\"), { loose }],\n       require(\"babel-plugin-transform-es2015-parameters\"),\n-      [require(\"babel-plugin-transform-es2015-destructuring\"), {loose: loose}],\n+      [require(\"babel-plugin-transform-es2015-destructuring\"), { loose }],\n       require(\"babel-plugin-transform-es2015-block-scoping\"),\n       require(\"babel-plugin-transform-es2015-typeof-symbol\"),\n-    ].concat(modules ? [\n-      [require(\"babel-plugin-transform-es2015-modules-commonjs\"), {loose: loose}],\n-    ] : []).concat([\n-      [require(\"babel-plugin-transform-regenerator\"), { async: false, asyncGenerators: false }],\n-    ]),\n+      modules === \"commonjs\" && [require(\"babel-plugin-transform-es2015-modules-commonjs\"), { loose }],\n+      modules === \"systemjs\" && require(\"babel-plugin-transform-es2015-modules-systemjs\"),\n+      modules === \"amd\" && require(\"babel-plugin-transform-es2015-modules-amd\"),\n+      modules === \"umd\" && require(\"babel-plugin-transform-es2015-modules-umd\"),\n+      [require(\"babel-plugin-transform-regenerator\"), { async: false, asyncGenerators: false }]\n+    // filter out falsy values\n+    ].filter((plugin) => plugin)","path":"packages/babel-preset-es2015/src/index.js","position":64,"original_position":64,"commit_id":"fa5a8876a78c4a0c92be0e4f93211a620d7ad713","original_commit_id":"fa5a8876a78c4a0c92be0e4f93211a620d7ad713","user":{"login":"loganfsmyth","id":132260,"avatar_url":"https://avatars.githubusercontent.com/u/132260?v=3","gravatar_id":"","url":"https://api.github.com/users/loganfsmyth","html_url":"https://github.com/loganfsmyth","followers_url":"https://api.github.com/users/loganfsmyth/followers","following_url":"https://api.github.com/users/loganfsmyth/following{/other_user}","gists_url":"https://api.github.com/users/loganfsmyth/gists{/gist_id}","starred_url":"https://api.github.com/users/loganfsmyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganfsmyth/subscriptions","organizations_url":"https://api.github.com/users/loganfsmyth/orgs","repos_url":"https://api.github.com/users/loganfsmyth/repos","events_url":"https://api.github.com/users/loganfsmyth/events{/privacy}","received_events_url":"https://api.github.com/users/loganfsmyth/received_events","type":"User","site_admin":false},"body":"Maybe `.filter(Boolean)`, or is that too obscure?","created_at":"2016-08-04T03:47:22Z","updated_at":"2016-08-04T03:47:22Z","html_url":"https://github.com/babel/babel/pull/3627#discussion_r73458728","pull_request_url":"https://api.github.com/repos/babel/babel/pulls/3627","_links":{"self":{"href":"https://api.github.com/repos/babel/babel/pulls/comments/73458728"},"html":{"href":"https://github.com/babel/babel/pull/3627#discussion_r73458728"},"pull_request":{"href":"https://api.github.com/repos/babel/babel/pulls/3627"}}},"pull_request":{"url":"https://api.github.com/repos/babel/babel/pulls/3627","id":80009057,"html_url":"https://github.com/babel/babel/pull/3627","diff_url":"https://github.com/babel/babel/pull/3627.diff","patch_url":"https://github.com/babel/babel/pull/3627.patch","issue_url":"https://api.github.com/repos/babel/babel/issues/3627","number":3627,"state":"open","locked":false,"title":"es2015: transpile the preset, add spec option","user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"body":"Ref https://github.com/babel/babel/pull/3331\r\n\r\nhttps://github.com/babel/babel/pull/3331#issuecomment-237430559\r\n\r\n> Dono if there's anything else we wanted to add for the es2015 preset - loose/modules makes sense.\r\n> Would it make sense for modules to be an enum rather than a boolean? AMD/UMD?\r\n> Maybe spec as well?\r\n\r\ncc @taion, @loganfsmyth \r\n\r\n- [x] spec option\r\n- [x] modules option\r\n- [ ] update readme\r\n- [ ] reminder to update the website docs","created_at":"2016-08-04T02:23:02Z","updated_at":"2016-08-04T03:47:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05e870cff388497b9ad66a3a1181b8e0192c0776","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/babel/babel/milestones/11","html_url":"https://github.com/babel/babel/milestones/Next%20Minor","labels_url":"https://api.github.com/repos/babel/babel/milestones/11/labels","id":1824136,"number":11,"title":"Next Minor","description":"","creator":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2016-06-13T17:31:54Z","updated_at":"2016-08-04T02:23:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/babel/babel/pulls/3627/commits","review_comments_url":"https://api.github.com/repos/babel/babel/pulls/3627/comments","review_comment_url":"https://api.github.com/repos/babel/babel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/babel/babel/issues/3627/comments","statuses_url":"https://api.github.com/repos/babel/babel/statuses/fa5a8876a78c4a0c92be0e4f93211a620d7ad713","head":{"label":"babel:es2015-opts","ref":"es2015-opts","sha":"fa5a8876a78c4a0c92be0e4f93211a620d7ad713","user":{"login":"babel","id":9637642,"avatar_url":"https://avatars.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"repo":{"id":24560307,"name":"babel","full_name":"babel/babel","owner":{"login":"babel","id":9637642,"avatar_url":"https://avatars.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/babel/babel","description":":tropical_fish: Babel is a compiler for writing next generation JavaScript.","fork":false,"url":"https://api.github.com/repos/babel/babel","forks_url":"https://api.github.com/repos/babel/babel/forks","keys_url":"https://api.github.com/repos/babel/babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babel/babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babel/babel/teams","hooks_url":"https://api.github.com/repos/babel/babel/hooks","issue_events_url":"https://api.github.com/repos/babel/babel/issues/events{/number}","events_url":"https://api.github.com/repos/babel/babel/events","assignees_url":"https://api.github.com/repos/babel/babel/assignees{/user}","branches_url":"https://api.github.com/repos/babel/babel/branches{/branch}","tags_url":"https://api.github.com/repos/babel/babel/tags","blobs_url":"https://api.github.com/repos/babel/babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babel/babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babel/babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/babel/babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babel/babel/statuses/{sha}","languages_url":"https://api.github.com/repos/babel/babel/languages","stargazers_url":"https://api.github.com/repos/babel/babel/stargazers","contributors_url":"https://api.github.com/repos/babel/babel/contributors","subscribers_url":"https://api.github.com/repos/babel/babel/subscribers","subscription_url":"https://api.github.com/repos/babel/babel/subscription","commits_url":"https://api.github.com/repos/babel/babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/babel/babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/babel/babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/babel/babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/babel/babel/contents/{+path}","compare_url":"https://api.github.com/repos/babel/babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babel/babel/merges","archive_url":"https://api.github.com/repos/babel/babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babel/babel/downloads","issues_url":"https://api.github.com/repos/babel/babel/issues{/number}","pulls_url":"https://api.github.com/repos/babel/babel/pulls{/number}","milestones_url":"https://api.github.com/repos/babel/babel/milestones{/number}","notifications_url":"https://api.github.com/repos/babel/babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babel/babel/labels{/name}","releases_url":"https://api.github.com/repos/babel/babel/releases{/id}","deployments_url":"https://api.github.com/repos/babel/babel/deployments","created_at":"2014-09-28T13:38:23Z","updated_at":"2016-08-04T03:37:17Z","pushed_at":"2016-08-04T03:14:53Z","git_url":"git://github.com/babel/babel.git","ssh_url":"git@github.com:babel/babel.git","clone_url":"https://github.com/babel/babel.git","svn_url":"https://github.com/babel/babel","homepage":"https://babeljs.io/","size":19242,"stargazers_count":16858,"watchers_count":16858,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1245,"mirror_url":null,"open_issues_count":223,"forks":1245,"open_issues":223,"watchers":16858,"default_branch":"master"}},"base":{"label":"babel:master","ref":"master","sha":"897f553dc7c6194f6dd788d0a1921d71c2c692d1","user":{"login":"babel","id":9637642,"avatar_url":"https://avatars.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"repo":{"id":24560307,"name":"babel","full_name":"babel/babel","owner":{"login":"babel","id":9637642,"avatar_url":"https://avatars.githubusercontent.com/u/9637642?v=3","gravatar_id":"","url":"https://api.github.com/users/babel","html_url":"https://github.com/babel","followers_url":"https://api.github.com/users/babel/followers","following_url":"https://api.github.com/users/babel/following{/other_user}","gists_url":"https://api.github.com/users/babel/gists{/gist_id}","starred_url":"https://api.github.com/users/babel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel/subscriptions","organizations_url":"https://api.github.com/users/babel/orgs","repos_url":"https://api.github.com/users/babel/repos","events_url":"https://api.github.com/users/babel/events{/privacy}","received_events_url":"https://api.github.com/users/babel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/babel/babel","description":":tropical_fish: Babel is a compiler for writing next generation JavaScript.","fork":false,"url":"https://api.github.com/repos/babel/babel","forks_url":"https://api.github.com/repos/babel/babel/forks","keys_url":"https://api.github.com/repos/babel/babel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babel/babel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babel/babel/teams","hooks_url":"https://api.github.com/repos/babel/babel/hooks","issue_events_url":"https://api.github.com/repos/babel/babel/issues/events{/number}","events_url":"https://api.github.com/repos/babel/babel/events","assignees_url":"https://api.github.com/repos/babel/babel/assignees{/user}","branches_url":"https://api.github.com/repos/babel/babel/branches{/branch}","tags_url":"https://api.github.com/repos/babel/babel/tags","blobs_url":"https://api.github.com/repos/babel/babel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babel/babel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babel/babel/git/refs{/sha}","trees_url":"https://api.github.com/repos/babel/babel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babel/babel/statuses/{sha}","languages_url":"https://api.github.com/repos/babel/babel/languages","stargazers_url":"https://api.github.com/repos/babel/babel/stargazers","contributors_url":"https://api.github.com/repos/babel/babel/contributors","subscribers_url":"https://api.github.com/repos/babel/babel/subscribers","subscription_url":"https://api.github.com/repos/babel/babel/subscription","commits_url":"https://api.github.com/repos/babel/babel/commits{/sha}","git_commits_url":"https://api.github.com/repos/babel/babel/git/commits{/sha}","comments_url":"https://api.github.com/repos/babel/babel/comments{/number}","issue_comment_url":"https://api.github.com/repos/babel/babel/issues/comments{/number}","contents_url":"https://api.github.com/repos/babel/babel/contents/{+path}","compare_url":"https://api.github.com/repos/babel/babel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babel/babel/merges","archive_url":"https://api.github.com/repos/babel/babel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babel/babel/downloads","issues_url":"https://api.github.com/repos/babel/babel/issues{/number}","pulls_url":"https://api.github.com/repos/babel/babel/pulls{/number}","milestones_url":"https://api.github.com/repos/babel/babel/milestones{/number}","notifications_url":"https://api.github.com/repos/babel/babel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babel/babel/labels{/name}","releases_url":"https://api.github.com/repos/babel/babel/releases{/id}","deployments_url":"https://api.github.com/repos/babel/babel/deployments","created_at":"2014-09-28T13:38:23Z","updated_at":"2016-08-04T03:37:17Z","pushed_at":"2016-08-04T03:14:53Z","git_url":"git://github.com/babel/babel.git","ssh_url":"git@github.com:babel/babel.git","clone_url":"https://github.com/babel/babel.git","svn_url":"https://github.com/babel/babel","homepage":"https://babeljs.io/","size":19242,"stargazers_count":16858,"watchers_count":16858,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1245,"mirror_url":null,"open_issues_count":223,"forks":1245,"open_issues":223,"watchers":16858,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/babel/babel/pulls/3627"},"html":{"href":"https://github.com/babel/babel/pull/3627"},"issue":{"href":"https://api.github.com/repos/babel/babel/issues/3627"},"comments":{"href":"https://api.github.com/repos/babel/babel/issues/3627/comments"},"review_comments":{"href":"https://api.github.com/repos/babel/babel/pulls/3627/comments"},"review_comment":{"href":"https://api.github.com/repos/babel/babel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/babel/babel/pulls/3627/commits"},"statuses":{"href":"https://api.github.com/repos/babel/babel/statuses/fa5a8876a78c4a0c92be0e4f93211a620d7ad713"}}}}
{"actor":{"display_login":"loganfsmyth"}}