{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5167","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5167/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5167/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5167/events","html_url":"https://github.com/eslint/eslint/issues/5167","id":131806800,"number":5167,"title":"`no-whitespace-before-property` false positive","user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/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":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-06T01:49:43Z","updated_at":"2016-02-09T15:21:59Z","closed_at":"2016-02-09T15:21:59Z","body":"Using eslint 2.0.0-rc.0.\r\n\r\nCode: \r\n\r\n```js\r\nvar arr = [1, 2, 3]\r\nvar first = arr[ 0 ]\r\n```\r\n\r\nRules:\r\n\r\n```js\r\n{\r\n  \"rules\": {\r\n    \"no-whitespace-before-property\": 2\r\n  }\r\n}\r\n```\r\n\r\nGives the following error:\r\n\r\n```\r\n  2:13  error  Unexpected whitespace before property 'undefined'  no-whitespace-before-property\r\n```\r\n\r\nThe rule shouldn't consider this to be invalid whitespace, since the whitespace occurs *within* the square brackets. Spacing within square brackets is already covered by another rule.\r\n\r\nThis should be continue to be considered an error:\r\n\r\n```js\r\nfoo [bar]\r\n```\r\n\r\nBut not this:\r\n\r\n```js\r\nfoo[ bar ]\r\n```\r\n\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/30595222-no-whitespace-before-property-false-positive?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>"}}