{"action":"opened","issue":{"url":"https://api.github.com/repos/feross/standard/issues/80","labels_url":"https://api.github.com/repos/feross/standard/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/feross/standard/issues/80/comments","events_url":"https://api.github.com/repos/feross/standard/issues/80/events","html_url":"https://github.com/feross/standard/issues/80","id":64127341,"number":80,"title":"Starting Lines With Semicolons (ES6)","user":{"login":"mattdesl","id":1383811,"avatar_url":"https://avatars.githubusercontent.com/u/1383811?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdesl","html_url":"https://github.com/mattdesl","followers_url":"https://api.github.com/users/mattdesl/followers","following_url":"https://api.github.com/users/mattdesl/following{/other_user}","gists_url":"https://api.github.com/users/mattdesl/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdesl/subscriptions","organizations_url":"https://api.github.com/users/mattdesl/orgs","repos_url":"https://api.github.com/users/mattdesl/repos","events_url":"https://api.github.com/users/mattdesl/events{/privacy}","received_events_url":"https://api.github.com/users/mattdesl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-24T23:32:58Z","updated_at":"2015-03-24T23:32:58Z","closed_at":null,"body":"Note: This isn't a question about whether to use ASI or not (already discussed #78).\r\n\r\n@maxogden \r\n\r\n> We no longer recommend starting lines with semicolons. It's hacky. Start lines with void, var, const or something that makes more sense.\r\n\r\nCan you expand on this a bit more? To me `void` is confusing and code-smell-ish. I don't really see anything wrong with enforcing a preceding semicolon for `[` and `(`, and disallowing lines starting with other operators (like regexes and template strings). \r\n\r\nPreceding semicolon:\r\n\r\n```js\r\nlet [ x, y ] = [ 8, 2 ]\r\n;[ x, y ] = [ y, x ]\r\n```\r\n\r\nVoid:\r\n\r\n```js\r\nlet [ x, y ] = [ 8, 2 ]\r\nvoid [ x, y ] = [ y, x ]\r\n```\r\n\r\nAvoiding it completely: \r\n\r\n```js\r\nlet [ x, y ] = [ 8, 2 ]\r\nlet t = x\r\nx = y\r\ny = t\r\n```\r\n\r\nAside from swapping variables, it can also be useful to write code like this:\r\n\r\n```js\r\n//translate Z and project into 2D\r\nlet [ x, y, z ] = position()\r\nz += translation\r\n;[ x, y ] = project([ x, y, z ])\r\n```"}}