{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5424","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5424/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5424/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5424/events","html_url":"https://github.com/eslint/eslint/issues/5424","id":136996358,"number":5424,"title":"Rule Proposal: Enforce no more than one statement per line","user":{"login":"scriptdaemon","id":1626636,"avatar_url":"https://avatars.githubusercontent.com/u/1626636?v=3","gravatar_id":"","url":"https://api.github.com/users/scriptdaemon","html_url":"https://github.com/scriptdaemon","followers_url":"https://api.github.com/users/scriptdaemon/followers","following_url":"https://api.github.com/users/scriptdaemon/following{/other_user}","gists_url":"https://api.github.com/users/scriptdaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/scriptdaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriptdaemon/subscriptions","organizations_url":"https://api.github.com/users/scriptdaemon/orgs","repos_url":"https://api.github.com/users/scriptdaemon/repos","events_url":"https://api.github.com/users/scriptdaemon/events{/privacy}","received_events_url":"https://api.github.com/users/scriptdaemon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/needs%20info","name":"needs info","color":"808000"},{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-28T02:40:13Z","updated_at":"2016-02-28T06:42:26Z","closed_at":null,"body":"There should be a rule to warn the developer when any line(s) of their code contains more than one statement (ignoring for loops).\r\n\r\nPassing code:\r\n```js\r\n    var test, test2, test3;\r\n\r\n    for (var i = 0; i < someNum; ++i) {\r\n        // Code\r\n    }\r\n\r\n    function doSomething() {\r\n        var obj = {\r\n            prop1: 'value',\r\n            prop2: 'otherValue'\r\n        };\r\n\r\n        console.log(obj.prop1);\r\n    }\r\n```\r\nNot passing code:\r\n```js\r\n    var test; var test2; var test3;\r\n\r\n    function doAThing() {\r\n        doAnotherThing(); return true;\r\n    }\r\n\r\n    switch(variable) {\r\n        case 'value1':\r\n            doSomething(); break;\r\n        default:\r\n            doSomethingElse(); break;\r\n    }\r\n```\r\nI think this will enforce better readability and make it easier to visualize changes. I am not against learning the ESLint codebase to create this rule myself, but if anyone else is able to do it quicker than by all means do so. I am willing to idle the Gitter chat to discuss the possibility of implementing this."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/189799136","html_url":"https://github.com/eslint/eslint/issues/5424#issuecomment-189799136","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5424","id":189799136,"user":{"login":"eslintbot","id":13383618,"avatar_url":"https://avatars.githubusercontent.com/u/13383618?v=3","gravatar_id":"","url":"https://api.github.com/users/eslintbot","html_url":"https://github.com/eslintbot","followers_url":"https://api.github.com/users/eslintbot/followers","following_url":"https://api.github.com/users/eslintbot/following{/other_user}","gists_url":"https://api.github.com/users/eslintbot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslintbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslintbot/subscriptions","organizations_url":"https://api.github.com/users/eslintbot/orgs","repos_url":"https://api.github.com/users/eslintbot/repos","events_url":"https://api.github.com/users/eslintbot/events{/privacy}","received_events_url":"https://api.github.com/users/eslintbot/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T06:42:26Z","updated_at":"2016-02-28T06:42:26Z","body":"Hi @scriptdaemon, thanks for the issue. It looks like there's not enough information for us to know how to help you. If you're reporting a bug, please be sure to include:\n\n1. The version of ESLint you are using (run `eslint -v`)\n2. What you did (the source code and ESLint configuration)\n3. The actual ESLint output complete with numbers\n4. What you expected to happen instead\n\nRequesting a new rule? Please see [Proposing a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules) for instructions.\n\nIf it's something else, please just provide as much additional information as possible. Thanks!"}}