Configuring VS Code for Vue (non-TypeScript) Projects to Get TypeScript-Style IntelliSense
The Problem
Once you have used TypeScript, it is hard to live without IntelliSense. But many older Vue projects don't use TypeScript and don't get IntelliSense out of the box in VS Code. With the right configuration plus the Vetur extension, you can still get IntelliSense and significantly improve your front-end productivity.
Features
Auto Import Method

Auto Resolve path and file

Add jsconfig.json to the project root
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"checkJs": true,
"baseUrl": ".",
"noLib": false,
"paths": {
"@/*": [
"src/*"
],
"@components/*": [
"src/components/*"
],
"@views/*": [
"src/views/*"
],
"@base/*": [
"src/base/*"
],
"@utils/*": [
"src/utils/*"
]
}
},
"include": [
"./src/**/*"
],
"exclude": [
"node_modules"
]
}
Setup
-
Open File > Preferences > Settings

-
Search for "check js" (with a space)

-
Enable Check JS

-
Install the Vetur extension in VS Code

-
Restart the VS Code project. Once it has reloaded, you'll have auto-import working.
-
Disable Vetur's Validate option






























Comments