{"action":"created","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1857","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1857/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1857/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1857/events","html_url":"https://github.com/jscs-dev/node-jscs/pull/1857","id":110604437,"number":1857,"title":"disallowSpaceAfterObjectKeys: fix #1818","user":{"login":"dreef3","id":1104138,"avatar_url":"https://avatars.githubusercontent.com/u/1104138?v=3","gravatar_id":"","url":"https://api.github.com/users/dreef3","html_url":"https://github.com/dreef3","followers_url":"https://api.github.com/users/dreef3/followers","following_url":"https://api.github.com/users/dreef3/following{/other_user}","gists_url":"https://api.github.com/users/dreef3/gists{/gist_id}","starred_url":"https://api.github.com/users/dreef3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreef3/subscriptions","organizations_url":"https://api.github.com/users/dreef3/orgs","repos_url":"https://api.github.com/users/dreef3/repos","events_url":"https://api.github.com/users/dreef3/events{/privacy}","received_events_url":"https://api.github.com/users/dreef3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jscs-dev/node-jscs/labels/reviewed%20once","name":"reviewed once","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/milestones/16","html_url":"https://github.com/jscs-dev/node-jscs/milestones/2.3.1","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/milestones/16/labels","id":1343725,"number":16,"title":"2.3.1","description":"","creator":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2015-10-08T00:57:20Z","updated_at":"2015-10-09T12:49:06Z","due_on":"2015-10-20T04:00:00Z","closed_at":null},"comments":3,"created_at":"2015-10-09T07:44:30Z","updated_at":"2015-10-10T15:20:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/pulls/1857","html_url":"https://github.com/jscs-dev/node-jscs/pull/1857","diff_url":"https://github.com/jscs-dev/node-jscs/pull/1857.diff","patch_url":"https://github.com/jscs-dev/node-jscs/pull/1857.patch"},"body":"Here's my attempt to fix #1818. Adds the following valid case to `disallowSpaceAfterObjectKeys` with `aligned` option:\r\n\r\n#### Config\r\n```javascript\r\ndisallowSpaceAfterObjectKeys: { allExcept: ['aligned'] }\r\n```\r\n\r\n#### Valid\r\n```javascript\r\nvar f = {\r\n    \"name\": 1,\r\n    \"x\": 2\r\n};\r\n```\r\n\r\nMaybe code that counts spaces could be moved to some utils file but I'm not sure where it should belong."},"comment":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/comments/147098516","html_url":"https://github.com/jscs-dev/node-jscs/pull/1857#issuecomment-147098516","issue_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1857","id":147098516,"user":{"login":"avdv","id":3471749,"avatar_url":"https://avatars.githubusercontent.com/u/3471749?v=3","gravatar_id":"","url":"https://api.github.com/users/avdv","html_url":"https://github.com/avdv","followers_url":"https://api.github.com/users/avdv/followers","following_url":"https://api.github.com/users/avdv/following{/other_user}","gists_url":"https://api.github.com/users/avdv/gists{/gist_id}","starred_url":"https://api.github.com/users/avdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avdv/subscriptions","organizations_url":"https://api.github.com/users/avdv/orgs","repos_url":"https://api.github.com/users/avdv/repos","events_url":"https://api.github.com/users/avdv/events{/privacy}","received_events_url":"https://api.github.com/users/avdv/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T15:20:37Z","updated_at":"2015-10-10T15:20:37Z","body":"I think this would erroneously permit:\r\n\r\n```javascript\r\nvar f = {\r\n    \"name\": 1,\r\n    \"x\"            : 2\r\n};\r\n```\r\nbecause you're completely disabling the check for individual lines without spaces. You would have to check whether all colons on all lines are at the same column or none of the lines actually has a space after the key."}}