{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/323","repository_url":"https://api.github.com/repos/vuejs/eslint-plugin-vue","labels_url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/323/comments","events_url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/323/events","html_url":"https://github.com/vuejs/eslint-plugin-vue/issues/323","id":285732942,"node_id":"MDU6SXNzdWUyODU3MzI5NDI=","number":323,"title":"Rule Proposal: Ensure prop.type is an Object","user":{"login":"richardtallent","id":2041718,"node_id":"MDQ6VXNlcjIwNDE3MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/2041718?v=4","gravatar_id":"","url":"https://api.github.com/users/richardtallent","html_url":"https://github.com/richardtallent","followers_url":"https://api.github.com/users/richardtallent/followers","following_url":"https://api.github.com/users/richardtallent/following{/other_user}","gists_url":"https://api.github.com/users/richardtallent/gists{/gist_id}","starred_url":"https://api.github.com/users/richardtallent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardtallent/subscriptions","organizations_url":"https://api.github.com/users/richardtallent/orgs","repos_url":"https://api.github.com/users/richardtallent/repos","events_url":"https://api.github.com/users/richardtallent/events{/privacy}","received_events_url":"https://api.github.com/users/richardtallent/received_events","type":"User","site_admin":false},"labels":[{"id":618977488,"node_id":"MDU6TGFiZWw2MTg5Nzc0ODg=","url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/labels/accepted%20proposition","name":"accepted proposition","color":"3db22e","default":false},{"id":618977310,"node_id":"MDU6TGFiZWw2MTg5NzczMTA=","url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/labels/new%20rule%20proposition","name":"new rule proposition","color":"fbca04","default":false},{"id":618977510,"node_id":"MDU6TGFiZWw2MTg5Nzc1MTA=","url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/labels/work%20in%20progress","name":"work in progress","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":{"login":"michalsnik","id":4093559,"node_id":"MDQ6VXNlcjQwOTM1NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4093559?v=4","gravatar_id":"","url":"https://api.github.com/users/michalsnik","html_url":"https://github.com/michalsnik","followers_url":"https://api.github.com/users/michalsnik/followers","following_url":"https://api.github.com/users/michalsnik/following{/other_user}","gists_url":"https://api.github.com/users/michalsnik/gists{/gist_id}","starred_url":"https://api.github.com/users/michalsnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalsnik/subscriptions","organizations_url":"https://api.github.com/users/michalsnik/orgs","repos_url":"https://api.github.com/users/michalsnik/repos","events_url":"https://api.github.com/users/michalsnik/events{/privacy}","received_events_url":"https://api.github.com/users/michalsnik/received_events","type":"User","site_admin":false},"assignees":[{"login":"michalsnik","id":4093559,"node_id":"MDQ6VXNlcjQwOTM1NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4093559?v=4","gravatar_id":"","url":"https://api.github.com/users/michalsnik","html_url":"https://github.com/michalsnik","followers_url":"https://api.github.com/users/michalsnik/followers","following_url":"https://api.github.com/users/michalsnik/following{/other_user}","gists_url":"https://api.github.com/users/michalsnik/gists{/gist_id}","starred_url":"https://api.github.com/users/michalsnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalsnik/subscriptions","organizations_url":"https://api.github.com/users/michalsnik/orgs","repos_url":"https://api.github.com/users/michalsnik/repos","events_url":"https://api.github.com/users/michalsnik/events{/privacy}","received_events_url":"https://api.github.com/users/michalsnik/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-01-03T16:12:57Z","updated_at":"2018-07-31T09:09:55Z","closed_at":null,"author_association":"NONE","body":"**Please describe what the rule should do:**\r\n\r\nEnsure that the `type` key for a property is passed as an Object, not as a string.\r\n\r\n**What category of rule is this? (place an \"X\" next to just one item)**\r\n\r\n[ ] Enforces code style\r\n[x] Warns about a potential error\r\n[ ] Suggests an alternate way of doing something\r\n[ ] Other (please specify:)\r\n\r\n**Provide 2-3 code examples that this rule will warn about:**\r\n\r\n```js\r\nprops: {\r\n\tmyFieldWithBadType: {\r\n\t\ttype: \"Object\",\r\n\t\tdefault: function() {\r\n\t\t\treturn {}\r\n\t\t},\r\n\t},\r\n\tmyOtherFieldWithBadType: {\r\n\t\ttype: \"Number\",\r\n\t\tdefault: 1,\r\n\t},\r\n}\r\n```\r\n\r\n**Why should this rule be included in ESLint (instead of a plugin)?**\r\n\r\nPassing a string to `type` rather than the name of the type results in a rather opaque error message from deep in the bowels of Vue, and it's an easy mistake to make."},"comment":{"url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/comments/409151520","html_url":"https://github.com/vuejs/eslint-plugin-vue/issues/323#issuecomment-409151520","issue_url":"https://api.github.com/repos/vuejs/eslint-plugin-vue/issues/323","id":409151520,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTE1MTUyMA==","user":{"login":"chrisvfritz","id":2327556,"node_id":"MDQ6VXNlcjIzMjc1NTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2327556?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisvfritz","html_url":"https://github.com/chrisvfritz","followers_url":"https://api.github.com/users/chrisvfritz/followers","following_url":"https://api.github.com/users/chrisvfritz/following{/other_user}","gists_url":"https://api.github.com/users/chrisvfritz/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvfritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvfritz/subscriptions","organizations_url":"https://api.github.com/users/chrisvfritz/orgs","repos_url":"https://api.github.com/users/chrisvfritz/repos","events_url":"https://api.github.com/users/chrisvfritz/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvfritz/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T09:09:55Z","updated_at":"2018-07-31T09:09:55Z","author_association":"MEMBER","body":"I like this! It would go in `essentials` and a more complete list of situations to match might be:\r\n\r\n``` js\r\nimport Foo from './foo'\r\nconst Bar = ''\r\n\r\n// ...\r\n\r\nprops: {\r\n  a: 'Object',\r\n  b: { type: 'Number' },\r\n  c: { type: `String` },\r\n  d: { type: Foo + '' },\r\n  e: { type: Bar },\r\n}\r\n```"}}
{"actor":{"display_login":"chrisvfritz"}}