{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack-cli/issues/258","repository_url":"https://api.github.com/repos/webpack/webpack-cli","labels_url":"https://api.github.com/repos/webpack/webpack-cli/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack-cli/issues/258/comments","events_url":"https://api.github.com/repos/webpack/webpack-cli/issues/258/events","html_url":"https://github.com/webpack/webpack-cli/issues/258","id":293352704,"number":258,"title":"configuration validation : strict \"Promise\" instanceof validation","user":{"login":"jbottigliero","id":694253,"avatar_url":"https://avatars3.githubusercontent.com/u/694253?v=4","gravatar_id":"","url":"https://api.github.com/users/jbottigliero","html_url":"https://github.com/jbottigliero","followers_url":"https://api.github.com/users/jbottigliero/followers","following_url":"https://api.github.com/users/jbottigliero/following{/other_user}","gists_url":"https://api.github.com/users/jbottigliero/gists{/gist_id}","starred_url":"https://api.github.com/users/jbottigliero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbottigliero/subscriptions","organizations_url":"https://api.github.com/users/jbottigliero/orgs","repos_url":"https://api.github.com/users/jbottigliero/repos","events_url":"https://api.github.com/users/jbottigliero/events{/privacy}","received_events_url":"https://api.github.com/users/jbottigliero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-01-31T23:41:37Z","updated_at":"2018-02-03T16:42:35Z","closed_at":null,"author_association":"MEMBER","body":"\r\n**Do you want to request a *feature* or report a *bug*?**\r\nFeature.\r\n\r\n**What is the current behavior?**\r\nwebpack/webpack-cli#240 introduces validation which causes `Promise` based configurations to pass due to `instanceof Function` being `true`.\r\n\r\n**What is the expected behavior?**\r\nAt the point the validation runs, the configuration can never be _just_ a `Function`, it's expected to be an object, an array of objects, or a `Promise`.\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\nProvide stricter validation schema.\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.**\r\n\r\nThe main concern with adding the above is that it requires webpack/webpack#6430.\r\n\r\nThe `ajv-keywords` package does not support `\"instanceof\": \"Promise\"` in versions `<3.1.0`, which has a `peerDependency` of `ajv@^6.0.0`.\r\n\r\nAn alternative to updating the package versions would be to add `Promise` as a \"custom\" constructor [(outlined here)](https://github.com/epoberezkin/ajv-keywords/tree/v2.1.1#instanceof), but this would still have to be implemented in `webpack/webpack` based `ajv` being configured in core, and not directly exposed.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack-cli/issues/comments/362831580","html_url":"https://github.com/webpack/webpack-cli/issues/258#issuecomment-362831580","issue_url":"https://api.github.com/repos/webpack/webpack-cli/issues/258","id":362831580,"user":{"login":"ev1stensberg","id":16735925,"avatar_url":"https://avatars0.githubusercontent.com/u/16735925?v=4","gravatar_id":"","url":"https://api.github.com/users/ev1stensberg","html_url":"https://github.com/ev1stensberg","followers_url":"https://api.github.com/users/ev1stensberg/followers","following_url":"https://api.github.com/users/ev1stensberg/following{/other_user}","gists_url":"https://api.github.com/users/ev1stensberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ev1stensberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev1stensberg/subscriptions","organizations_url":"https://api.github.com/users/ev1stensberg/orgs","repos_url":"https://api.github.com/users/ev1stensberg/repos","events_url":"https://api.github.com/users/ev1stensberg/events{/privacy}","received_events_url":"https://api.github.com/users/ev1stensberg/received_events","type":"User","site_admin":false},"created_at":"2018-02-03T16:42:35Z","updated_at":"2018-02-03T16:42:35Z","author_association":"MEMBER","body":"Sounds good\r\n"}}
{"actor":{"display_login":"ev1stensberg"}}