{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/1727","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/1727/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1727/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/1727/events","html_url":"https://github.com/eslint/eslint/issues/1727","id":55405650,"number":1727,"title":"Rule enhancement: \"key-spacing\" does not consider tab as a whitespace","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/beginner","name":"beginner","color":"fef2c0"},{"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":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-25T08:47:00Z","updated_at":"2016-03-17T20:23:08Z","closed_at":"2016-03-17T20:23:08Z","body":"The rule key-spacing is already great but unfortunately it does not correctly work when using tab instead of space as a whitespace.\r\n\r\nThis causes false positives when\r\n* aligning using tab\r\n* when mixing tabs and spaces\r\n\r\nExample (`\"key-spacing\": [2, {\"align\": \"value\", \"beforeColon\": false, \"afterColon\": true}]`):\r\n```\r\nvar obj1 = {\r\n\tprop:<tab>'value',\r\n\tp:<tab><tab>'value'\r\n};\r\n\r\n3:5  error  Missing space before value for key \"p\"  key-spacing\r\n```\r\n\r\nExample (`\"key-spacing\": [2, {\"beforeColon\": false, \"afterColon\": true}]`):\r\n\r\n```\r\nvar obj2 = {\r\n\tprop:<space><space><space>'value',\r\n\tp:<tab><tab>'value'\r\n};\r\n\r\n3:4  error  Missing space before value for key \"p\"  key-spacing\r\n```\r\n\r\nTo keep the rule as generic as possible, it would be great to have an additional option \"tab\" ´[2, {\"align\": \"value\", \"beforeColon\": false, \"afterColon\": true, \"tab\": 4}]` that can either be undefined to keep the exiting behavior or be set to the number of spaces it should expand to. If it is set it should treat tab like space when not using align alignment and expand to the given number of spaces when using align.\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8015756-rule-enhancement-key-spacing-does-not-consider-tab-as-a-whitespace?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>"}}