### Version 3.6.5 ### Reproduction link [lzy1960/vue-router-query-ts-error](https://github.com/lzy1960/vue-router-query-ts-error) ### Steps to reproduce run `npx eslint src/views/HomeView.vue`, then throw two eslint warning ### What is expected? 1. `getElementsByClassName` maybe return undefined, so `secondPart` is not always falsy 2. `this.$route.query.xxx` maybe undefined, but the type is not contain undefined In short, neither warning should appear. ### What is actually happening? Two `no-autofix/@typescript-eslint/no-unnecessary-condition` appeared that should not appear <!-- generated by vue-issues. DO NOT REMOVE -->