{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/1797","labels_url":"https://api.github.com/repos/eslint/eslint/issues/1797/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1797/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/1797/events","html_url":"https://github.com/eslint/eslint/issues/1797","id":56951138,"number":1797,"title":"Indent rule: unable to enforce indentation of switch cases [$15]","user":{"login":"lo1tuma","id":169170,"avatar_url":"https://avatars.githubusercontent.com/u/169170?v=3","gravatar_id":"","url":"https://api.github.com/users/lo1tuma","html_url":"https://github.com/lo1tuma","followers_url":"https://api.github.com/users/lo1tuma/followers","following_url":"https://api.github.com/users/lo1tuma/following{/other_user}","gists_url":"https://api.github.com/users/lo1tuma/gists{/gist_id}","starred_url":"https://api.github.com/users/lo1tuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lo1tuma/subscriptions","organizations_url":"https://api.github.com/users/lo1tuma/orgs","repos_url":"https://api.github.com/users/lo1tuma/repos","events_url":"https://api.github.com/users/lo1tuma/events{/privacy}","received_events_url":"https://api.github.com/users/lo1tuma/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/bounty","name":"bounty","color":"129e5e"},{"url":"https://api.github.com/repos/eslint/eslint/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-08T13:15:28Z","updated_at":"2015-04-26T00:57:09Z","closed_at":null,"body":"The following code results in having no errors:\r\n\r\n`eslint --reset --no-eslintrc --rule \"{indent: 2}\" test.js`\r\n```js\r\nswitch (a) {\r\ncase '1':\r\nb();\r\nbreak;\r\ndefault:\r\nc();\r\nbreak;\r\n}\r\n```\r\n\r\nIf I enable the `indentSwitchCase` option I get the following errors:\r\n`eslint --reset --no-eslintrc --rule \"{indent: [2, 4, {indentSwitchCase: true}]}\" test.js`\r\n\r\n```sh\r\ntest.js\r\n  3:4  error  Expected indentation of 4 characters  indent\r\n  6:4  error  Expected indentation of 4 characters  indent\r\n```\r\n\r\nI would expect the following errors:\r\n```sh\r\ntest.js\r\n  2:4  error  Expected indentation of 4 characters  indent\r\n  3:8  error  Expected indentation of 8 characters  indent\r\n  4:8  error  Expected indentation of 8 characters  indent\r\n  5:4  error  Expected indentation of 4 characters  indent\r\n  6:8  error  Expected indentation of 8 characters  indent\r\n  7:8  error  Expected indentation of 8 characters  indent\r\n```\r\n\r\nIt seems like the `indentSwitchCase` option enables the indentation check only of the body of a SwitchCase statement. The Indentation of the whole SwitchCase statement is recognized by the rule itself and only validated to be consistet within an single switch statement. There is no option to confiugre a consistent identation for SwitchCase statements of a whole file.\r\n\r\nThe other strange behavior with this option is, when I explecitly set the value to `false` it doesn’t forbid the identation for a SwitchCase body, it just ignores those lines.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8393484-indent-rule-unable-to-enforce-indentation-of-switch-cases?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/96299658","html_url":"https://github.com/eslint/eslint/issues/1797#issuecomment-96299658","issue_url":"https://api.github.com/repos/eslint/eslint/issues/1797","id":96299658,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2015-04-26T00:57:09Z","updated_at":"2015-04-26T00:57:09Z","body":"Yeah, I'd expect `break` to be indented by default."}}