{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/6691","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/6691/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6691/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/6691/events","html_url":"https://github.com/eslint/eslint/issues/6691","id":165901296,"number":6691,"title":"`key-spacing`: `multiLine.align.mode` is overridden, `multiLine.mode` with `align` causes an error","user":{"login":"whizark","id":1211058,"avatar_url":"https://avatars.githubusercontent.com/u/1211058?v=3","gravatar_id":"","url":"https://api.github.com/users/whizark","html_url":"https://github.com/whizark","followers_url":"https://api.github.com/users/whizark/followers","following_url":"https://api.github.com/users/whizark/following{/other_user}","gists_url":"https://api.github.com/users/whizark/gists{/gist_id}","starred_url":"https://api.github.com/users/whizark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whizark/subscriptions","organizations_url":"https://api.github.com/users/whizark/orgs","repos_url":"https://api.github.com/users/whizark/repos","events_url":"https://api.github.com/users/whizark/events{/privacy}","received_events_url":"https://api.github.com/users/whizark/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/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,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-16T01:08:44Z","updated_at":"2016-08-27T00:56:05Z","closed_at":null,"body":"**What version of ESLint are you using?**\r\nESLint 3.1.0\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\ndefault\r\n\r\n**Please show your full configuration:**\r\n\r\ncase1.js\r\n```javascript\r\nmodule.exports = {\r\n    \"rules\"   : {\r\n        \"key-spacing\"                  : [\r\n            \"error\",\r\n            {\r\n                \"multiLine\" : {\r\n                    \"beforeColon\": false,\r\n                    \"afterColon\" : true,\r\n                    \"mode\"       : \"strict\",\r\n                    \"align\"      : {\r\n                        \"beforeColon\": false,\r\n                        \"afterColon\" : true,\r\n                        \"on\"         : \"colon\",\r\n                        \"mode\"       : \"minimum\"\r\n                    }\r\n                }\r\n            }\r\n        ]\r\n    }\r\n};\r\n```\r\n\r\ncase2.js\r\n```javascript\r\nmodule.exports = {\r\n    \"rules\": {\r\n        \"key-spacing\": [\r\n            \"error\",\r\n            {\r\n                \"multiLine\": {\r\n                    \"beforeColon\": false,\r\n                    \"afterColon\" : true,\r\n                    \"mode\"       : \"strict\"\r\n                },\r\n                \"align\"    : {\r\n                    \"beforeColon\": false,\r\n                    \"afterColon\" : true,\r\n                    \"on\"         : \"colon\",\r\n                    \"mode\"       : \"minimum\"\r\n                }\r\n            }\r\n        ]\r\n    }\r\n};\r\n```\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\n\r\ntest.js\r\n```javascript\r\nvar a = {\r\n    foo   : 1,\r\n    align1: {\r\n        foo:    2\r\n    },\r\n    align2: {\r\n        foo:    3\r\n    },\r\n    bar: 4\r\n};\r\n```\r\n\r\n**What did you expect to happen?**\r\n\r\nCase 1\r\n```shell\r\n  5:5   warning  Unexpected a line break before this close brace  object-curly-newline\r\n  6:13  warning  Unexpected a line break after this open brace    object-curly-newline\r\n```\r\n\r\nCase2\r\n```shell\r\n  1:1   error    Unexpected var, use let or const instead         no-var\r\n  1:5   error    'a' is defined but never used                    no-unused-vars\r\n  3:13  warning  Unexpected a line break after this open brace    object-curly-newline\r\n  5:5   warning  Unexpected a line break before this close brace  object-curly-newline\r\n  6:13  warning  Unexpected a line break after this open brace    object-curly-newline\r\n  8:5   warning  Unexpected a line break before this close brace  object-curly-newline\r\n```\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\n\r\nCase 1\r\n```shell\r\n  4:17  error    Extra space before value for key 'foo'           key-spacing\r\n  5:5   warning  Unexpected a line break before this close brace  object-curly-newline\r\n  6:13  warning  Unexpected a line break after this open brace    object-curly-newline\r\n  7:17  error    Extra space before value for key 'foo'           key-spacing\r\n```\r\nBecause of https://github.com/eslint/eslint/blob/67c3cc2fa655e9e92e01d7a88e9a9d60cd4a4ce9/lib/rules/key-spacing.js#L139\r\n\r\nCase2\r\n```shell\r\n/path/to/config/case2.js:\r\n        Configuration for rule \"key-spacing\" is invalid:\r\n        Value \"[object Object]\" no schemas match.\r\n\r\nError: /path/to/config/case2.js:\r\n        Configuration for rule \"key-spacing\" is invalid:\r\n        Value \"[object Object]\" no schemas match.\r\n```\r\n\r\nBecause of https://github.com/eslint/eslint/blob/67c3cc2fa655e9e92e01d7a88e9a9d60cd4a4ce9/lib/rules/key-spacing.js#L271-L321 (`multiLine.mode` isn't allowed with `align` option)\r\n\r\nAre they designed as they are?"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/242885314","html_url":"https://github.com/eslint/eslint/issues/6691#issuecomment-242885314","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6691","id":242885314,"user":{"login":"azhang496","id":6464196,"avatar_url":"https://avatars.githubusercontent.com/u/6464196?v=3","gravatar_id":"","url":"https://api.github.com/users/azhang496","html_url":"https://github.com/azhang496","followers_url":"https://api.github.com/users/azhang496/followers","following_url":"https://api.github.com/users/azhang496/following{/other_user}","gists_url":"https://api.github.com/users/azhang496/gists{/gist_id}","starred_url":"https://api.github.com/users/azhang496/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azhang496/subscriptions","organizations_url":"https://api.github.com/users/azhang496/orgs","repos_url":"https://api.github.com/users/azhang496/repos","events_url":"https://api.github.com/users/azhang496/events{/privacy}","received_events_url":"https://api.github.com/users/azhang496/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T00:56:05Z","updated_at":"2016-08-27T00:56:05Z","body":"@btmills i can do both! i didn't realize the goal was to fix both cases, since just fixing case 1 would give the option to have different modes for `multiline` and `align`"}}
{"actor":{"display_login":"azhang496"}}