Ignore eslint.config.js,because it have an error like this:
This will not affect the type check of the eslint.config.js,because eslint.config.js have @ts-check in first line.
Change moduleResolutiontoBundler, because unplugin-vue-router use declare module 'vue-router/auto' to define a macros-like API, it will only take effect in Bundler mode.
Because it is not set to bundler, the type of useRoute and useRouter is always any:
Description
eslint.config.js
,because it have an error like this:This will not affect the type check of the
eslint.config.js
,becauseeslint.config.js
have@ts-check
in first line.moduleResolution
toBundler
, becauseunplugin-vue-router
usedeclare module 'vue-router/auto'
to define a macros-like API, it will only take effect inBundler
mode.Because it is not set to
bundler
, the type ofuseRoute
anduseRouter
is alwaysany
:This bug has puzzled me for a long time😭