Closed lzy1960 closed 7 months ago
3.6.5
lzy1960/vue-router-query-ts-error
run npx eslint src/views/HomeView.vue, then throw two eslint warning
npx eslint src/views/HomeView.vue
getElementsByClassName
secondPart
this.$route.query.xxx
In short, neither warning should appear.
Two no-autofix/@typescript-eslint/no-unnecessary-condition appeared that should not appear
no-autofix/@typescript-eslint/no-unnecessary-condition
Duplicate of https://github.com/vuejs/router/issues/1891#issuecomment-1595987482
In short, it's a breaking change and it will happen in a next major
Version
3.6.5
Reproduction link
lzy1960/vue-router-query-ts-error
Steps to reproduce
run
npx eslint src/views/HomeView.vue
, then throw two eslint warningWhat is expected?
getElementsByClassName
maybe return undefined, sosecondPart
is not always falsythis.$route.query.xxx
maybe undefined, but the type is not contain undefinedIn short, neither warning should appear.
What is actually happening?
Two
no-autofix/@typescript-eslint/no-unnecessary-condition
appeared that should not appear