{"action":"created","issue":{"url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/439","labels_url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/439/labels{/name}","comments_url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/439/comments","events_url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/439/events","html_url":"https://github.com/Glavin001/atom-beautify/issues/439","id":92418577,"number":439,"title":"JS Beautify does not handle `space_before_conditional` for Javascript","user":{"login":"KINFOO","id":154818,"avatar_url":"https://avatars.githubusercontent.com/u/154818?v=3","gravatar_id":"","url":"https://api.github.com/users/KINFOO","html_url":"https://github.com/KINFOO","followers_url":"https://api.github.com/users/KINFOO/followers","following_url":"https://api.github.com/users/KINFOO/following{/other_user}","gists_url":"https://api.github.com/users/KINFOO/gists{/gist_id}","starred_url":"https://api.github.com/users/KINFOO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KINFOO/subscriptions","organizations_url":"https://api.github.com/users/KINFOO/orgs","repos_url":"https://api.github.com/users/KINFOO/repos","events_url":"https://api.github.com/users/KINFOO/events{/privacy}","received_events_url":"https://api.github.com/users/KINFOO/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Glavin001/atom-beautify/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"Glavin001","id":1885333,"avatar_url":"https://avatars.githubusercontent.com/u/1885333?v=3","gravatar_id":"","url":"https://api.github.com/users/Glavin001","html_url":"https://github.com/Glavin001","followers_url":"https://api.github.com/users/Glavin001/followers","following_url":"https://api.github.com/users/Glavin001/following{/other_user}","gists_url":"https://api.github.com/users/Glavin001/gists{/gist_id}","starred_url":"https://api.github.com/users/Glavin001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glavin001/subscriptions","organizations_url":"https://api.github.com/users/Glavin001/orgs","repos_url":"https://api.github.com/users/Glavin001/repos","events_url":"https://api.github.com/users/Glavin001/events{/privacy}","received_events_url":"https://api.github.com/users/Glavin001/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Glavin001/atom-beautify/milestones/6","html_url":"https://github.com/Glavin001/atom-beautify/milestones/v0.29.0","labels_url":"https://api.github.com/repos/Glavin001/atom-beautify/milestones/6/labels","id":1123999,"number":6,"title":"v0.29.0","description":"","creator":{"login":"Glavin001","id":1885333,"avatar_url":"https://avatars.githubusercontent.com/u/1885333?v=3","gravatar_id":"","url":"https://api.github.com/users/Glavin001","html_url":"https://github.com/Glavin001","followers_url":"https://api.github.com/users/Glavin001/followers","following_url":"https://api.github.com/users/Glavin001/following{/other_user}","gists_url":"https://api.github.com/users/Glavin001/gists{/gist_id}","starred_url":"https://api.github.com/users/Glavin001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glavin001/subscriptions","organizations_url":"https://api.github.com/users/Glavin001/orgs","repos_url":"https://api.github.com/users/Glavin001/repos","events_url":"https://api.github.com/users/Glavin001/events{/privacy}","received_events_url":"https://api.github.com/users/Glavin001/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":37,"state":"open","created_at":"2015-05-21T19:52:40Z","updated_at":"2015-07-01T19:53:41Z","due_on":"2015-06-15T03:00:00Z","closed_at":null},"comments":6,"created_at":"2015-07-01T15:51:22Z","updated_at":"2015-07-02T10:08:23Z","closed_at":"2015-07-01T19:52:32Z","body":"Hi,\r\n\r\nI am using atom __v0.210__ with atom-beautify __v0.28.7__.\r\n\r\nGiven this file:\r\n\r\n```js\r\n$ cat /tmp/functionSample.js\r\nvar functionSample=function(){\r\nreturn;\r\n};\r\n```\r\n\r\nWith this configuration:\r\n\r\n```json\r\n$ cat ~/.jsbeautifyrc \r\n{\r\n  \"end_with_newline\": true,\r\n  \"indent_size\": 4,\r\n  \"indent_char\": \" \",\r\n  \"indent_level\": 0,\r\n  \"space_after_anon_function\": false\r\n}\r\n```\r\n\r\nFormatting with `js-beautify`, I get:\r\n\r\n```js\r\n$ js-beautify /tmp/functionSample.js \r\nvar functionSample = function() {\r\n    return;\r\n};\r\n```\r\n\r\nFormatting in atom, I get:\r\n\r\n```js\r\nvar functionSample = function () {\r\n    return;\r\n};\r\n```\r\n\r\n__Problem__: There is an extra space after `function`.\r\n\r\n```diff\r\n1c1\r\n< var functionSample = function () {\r\n---\r\n> var functionSample = function() {\r\n```\r\n\r\nI think this extra space is a bug, because `space_before_conditional` option does not impact formating.\r\nAm I right?\r\n\r\nThanks for the good work.\r\nKevin"},"comment":{"url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/comments/117989089","html_url":"https://github.com/Glavin001/atom-beautify/issues/439#issuecomment-117989089","issue_url":"https://api.github.com/repos/Glavin001/atom-beautify/issues/439","id":117989089,"user":{"login":"Glavin001","id":1885333,"avatar_url":"https://avatars.githubusercontent.com/u/1885333?v=3","gravatar_id":"","url":"https://api.github.com/users/Glavin001","html_url":"https://github.com/Glavin001","followers_url":"https://api.github.com/users/Glavin001/followers","following_url":"https://api.github.com/users/Glavin001/following{/other_user}","gists_url":"https://api.github.com/users/Glavin001/gists{/gist_id}","starred_url":"https://api.github.com/users/Glavin001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glavin001/subscriptions","organizations_url":"https://api.github.com/users/Glavin001/orgs","repos_url":"https://api.github.com/users/Glavin001/repos","events_url":"https://api.github.com/users/Glavin001/events{/privacy}","received_events_url":"https://api.github.com/users/Glavin001/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T10:08:23Z","updated_at":"2015-07-02T10:08:23Z","body":"Could you try with the `.jsbeautifyrc` being:\r\n\r\n```json\r\n{\r\n    \"indent_size\": 4,\r\n    \"indent_char\": \" \",\r\n    \"indent_with_tabs\": false,\r\n    \"jslint_happy\": true,\r\n    \"end_with_newline\": true,\r\n    \"space_before_conditional\": false,\r\n    \"indent_level\": 0,\r\n    \"preserve_newlines\": true,\r\n    \"max_preserve_newlines\": 10,\r\n    \"space_in_paren\": false,\r\n    \"space_after_anon_function\": false,\r\n    \"brace_style\": \"collapse\",\r\n    \"break_chained_methods\": false,\r\n    \"keep_array_indentation\": false,\r\n    \"keep_function_indentation\": false,\r\n    \"eval_code\": false,\r\n    \"unescape_strings\": false,\r\n    \"wrap_line_length\": 0\r\n}\r\n```\r\n"}}