{"action":"closed","issue":{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/715","repository_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react","labels_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/715/comments","events_url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/issues/715/events","html_url":"https://github.com/yannickcr/eslint-plugin-react/issues/715","id":167522362,"number":715,"title":"Rule proposal: ensure style prop on DOM element tags is an object","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/yannickcr/eslint-plugin-react/labels/new%20rule","name":"new rule","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-26T05:12:01Z","updated_at":"2016-08-22T19:34:25Z","closed_at":"2016-08-22T19:34:25Z","body":"React will issue a warning in dev if you pass a non-object to the `style` prop on DOM element tags\r\n\r\nhttps://github.com/facebook/react/blob/85dcbf83/src/renderers/dom/shared/ReactDOMComponent.js#L204-L207\r\n\r\nThis should be easy enough to enforce for most cases with a linter rule.\r\n\r\nBad:\r\n\r\n```jsx\r\n<div style=\"foo\" />\r\n```\r\n\r\n```jsx\r\n<div style={true} />\r\n```\r\n\r\n```jsx\r\nconst styles = true;\r\n<div style={styles} />\r\n```\r\n\r\nGood:\r\n\r\n```jsx\r\n<div style={{ color: 'red' }} />\r\n```\r\n\r\n```jsx\r\nconst styles = { color: 'red' };\r\n<div style={styles} />\r\n```\r\n\r\nIt would be even nicer if it validated that the values of the style object are all strings."}}
{"actor":{"display_login":"yannickcr"}}