{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/1728","labels_url":"https://api.github.com/repos/eslint/eslint/issues/1728/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1728/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/1728/events","html_url":"https://github.com/eslint/eslint/issues/1728","id":55406007,"number":1728,"title":"Rule enhancement: \"key-spacing\" allow aligned and non-aligned style per group","user":{"login":"doberkofler","id":1009585,"avatar_url":"https://avatars.githubusercontent.com/u/1009585?v=3","gravatar_id":"","url":"https://api.github.com/users/doberkofler","html_url":"https://github.com/doberkofler","followers_url":"https://api.github.com/users/doberkofler/followers","following_url":"https://api.github.com/users/doberkofler/following{/other_user}","gists_url":"https://api.github.com/users/doberkofler/gists{/gist_id}","starred_url":"https://api.github.com/users/doberkofler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doberkofler/subscriptions","organizations_url":"https://api.github.com/users/doberkofler/orgs","repos_url":"https://api.github.com/users/doberkofler/repos","events_url":"https://api.github.com/users/doberkofler/events{/privacy}","received_events_url":"https://api.github.com/users/doberkofler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc"},{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-01-25T08:57:57Z","updated_at":"2015-01-31T08:46:27Z","closed_at":null,"body":"I would be great to relax the \"key-spacing\" rule by allowing to use type aligned AND the non-aligned style per group. Currently every group must be either aligned or not and it would be helpful to only have each group to be either aligned or not.\r\n\r\nExample (`\"key-spacing\": [2, {\"align\": \"value\", \"beforeColon\": false,\"afterColon\": true}]`):\r\n```\r\nvar obj1 = {\r\n\tprop: 'value',\r\n\tp:    'value'\r\n};\r\n\r\nvar obj2 = {\r\n\tprop: 'value',\r\n\tp: 'value'\r\n};\r\n\r\n8:4  error  Missing space before value for key \"p\"  key-spacing\r\n```\r\n\r\nA possible way to configure this would be to have an additional option \"align-optional\" that has the same functionality as currently align has but is only only considered per group.\r\n\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/8015838-rule-enhancement-key-spacing-allow-aligned-and-non-aligned-style-per-group?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/72309895","html_url":"https://github.com/eslint/eslint/issues/1728#issuecomment-72309895","issue_url":"https://api.github.com/repos/eslint/eslint/issues/1728","id":72309895,"user":{"login":"mourner","id":25395,"avatar_url":"https://avatars.githubusercontent.com/u/25395?v=3","gravatar_id":"","url":"https://api.github.com/users/mourner","html_url":"https://github.com/mourner","followers_url":"https://api.github.com/users/mourner/followers","following_url":"https://api.github.com/users/mourner/following{/other_user}","gists_url":"https://api.github.com/users/mourner/gists{/gist_id}","starred_url":"https://api.github.com/users/mourner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mourner/subscriptions","organizations_url":"https://api.github.com/users/mourner/orgs","repos_url":"https://api.github.com/users/mourner/repos","events_url":"https://api.github.com/users/mourner/events{/privacy}","received_events_url":"https://api.github.com/users/mourner/received_events","type":"User","site_admin":false},"created_at":"2015-01-31T08:46:27Z","updated_at":"2015-01-31T08:46:27Z","body":"> \"alignment of property groups is optional, but if a group is aligned, it should be aligned on (colon|value, pick just one)\"\r\n\r\nSounds perfect."}}