{"action":"opened","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/10939","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/10939/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/10939/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/10939/events","html_url":"https://github.com/eslint/eslint/issues/10939","id":367712114,"node_id":"MDU6SXNzdWUzNjc3MTIxMTQ=","number":10939,"title":"no-unused-expression incorrectly fails with optional-chaining (babel-eslint)","user":{"login":"marudor","id":1881725,"node_id":"MDQ6VXNlcjE4ODE3MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1881725?v=4","gravatar_id":"","url":"https://api.github.com/users/marudor","html_url":"https://github.com/marudor","followers_url":"https://api.github.com/users/marudor/followers","following_url":"https://api.github.com/users/marudor/following{/other_user}","gists_url":"https://api.github.com/users/marudor/gists{/gist_id}","starred_url":"https://api.github.com/users/marudor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marudor/subscriptions","organizations_url":"https://api.github.com/users/marudor/orgs","repos_url":"https://api.github.com/users/marudor/repos","events_url":"https://api.github.com/users/marudor/events{/privacy}","received_events_url":"https://api.github.com/users/marudor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-08T09:46:13Z","updated_at":"2018-10-08T09:46:13Z","closed_at":null,"author_association":"NONE","body":"**Tell us about your environment**\r\n\r\n* **ESLint Version:** 5.6.1\r\n* **Node Version:** 8.12.0\r\n* **npm Version:** 6.4.1\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?** Babel-ESlint\r\n\r\n**Please show your full configuration:**\r\n\r\n<details>\r\n<summary>Configuration</summary>\r\n\r\n<!-- Paste your configuration below: -->\r\n```js\r\n{\r\n  parser: 'babel-eslint',\r\n  rules: {\r\n    'no-unused-expressions': 1,\r\n  },\r\n}\r\n```\r\n\r\n</details>\r\n\r\n**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.**\r\n\r\n<!-- Paste the source code below: -->\r\n```js\r\nfunction testFn() {}\r\ntestFn?.();\r\n```\r\n\r\n<!-- Paste the command you used to run ESLint: -->\r\n```bash\r\nnpx eslint <filename>\r\n```\r\n\r\n**What did you expect to happen?**\r\nExpect no error as I used testFn\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\n```\r\n2:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions\r\n```\r\n\r\nHappens because babylon reports OptionalChaining as type \"OptionalCallExpression\" since 8.2.2. With 8.2.1 it was just \"CallExpression\".\r\nBoth report the node as optional as well.\r\n"}}
{"actor":{"display_login":"marudor"}}