In VS Code with Vetur (the extension for working with Vue), "Go to definition" will not work on component imports where there's no .vue extension at the end (Vetur FAQ link)
I was wondering if there's an eslint rule that will force the user to always provide an extension when using an import statement in .vue files?
Examples:
✔️ This works:
import HelloWorld from '@/components/HelloWorld.vue'Right clicking on
HelloWorldand pressingGo to definitionin VS Code wil take you to theHelloWorld.vuefile.❌ This doesn't:
import HelloWorld from '@/components/HelloWorld'If you press
Go to definitiononHelloWorld(leftmost), VS Code will just move the cursor to theHelloWorldyou just right clicked. Intended behavior is that we move to theHelloWorld.vuefile.
