{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/678","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/678/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/678/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/678/events","html_url":"https://github.com/Microsoft/vscode/issues/678","id":118944125,"number":678,"title":"[JavaScript] Incorrect 'new' keyword warning","user":{"login":"Tyriar","id":2193314,"avatar_url":"https://avatars.githubusercontent.com/u/2193314?v=3","gravatar_id":"","url":"https://api.github.com/users/Tyriar","html_url":"https://github.com/Tyriar","followers_url":"https://api.github.com/users/Tyriar/followers","following_url":"https://api.github.com/users/Tyriar/following{/other_user}","gists_url":"https://api.github.com/users/Tyriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Tyriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tyriar/subscriptions","organizations_url":"https://api.github.com/users/Tyriar/orgs","repos_url":"https://api.github.com/users/Tyriar/repos","events_url":"https://api.github.com/users/Tyriar/events{/privacy}","received_events_url":"https://api.github.com/users/Tyriar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-25T23:55:18Z","updated_at":"2015-11-25T23:55:18Z","closed_at":null,"body":"I'm seeing this warning complaining about me calling a non-void function with the `new` keyword, when it actually is a void function.\r\n\r\n![void_function](https://cloud.githubusercontent.com/assets/2193314/11412024/49d59198-938c-11e5-8c88-f0b761601310.png)\r\n\r\nReproduces with this code:\r\n\r\n```js\r\nvar BinomialHeap = function (customCompare) {\r\n  this.head = undefined;\r\n  this.nodeCount = 0;\r\n\r\n  if (customCompare) {\r\n    this.compare = customCompare;\r\n  }\r\n};\r\n\r\nfunction removeTreeRoot(heap, root, prev) {\r\n  // Remove root from the heap\r\n  if (root === heap.head) {\r\n    heap.head = root.sibling;\r\n  } else {\r\n    prev.sibling = root.sibling;\r\n  }\r\n\r\n  // Reverse the order of root's children and make a new heap\r\n  var newHead;\r\n  var child = root.child;\r\n  while (child) {\r\n    var next = child.sibling;\r\n    child.sibling = newHead;\r\n    child.parent = undefined;\r\n    newHead = child;\r\n    child = next;\r\n  }\r\n  var newHeap = new BinomialHeap();\r\n  newHeap.head = newHead;\r\n\r\n  heap.union(newHeap);\r\n}\r\n```\r\n\r\nIt actually goes away when I add `undefined` as an argument but that means the warning is complaining about the wrong thing. Also I don't think it's appropriate for the linter to warn on optional arguments in JavaScript like this by default as that's very strict."}}