Vue js and VS code - no Intellisense for absolute file path
You 'd be needing a jsconfig.json
file for the Intellisense to kick in with webpack aliases. You can check the linked article.
https://medium.com/@justintulk/solve-module-import-aliasing-for-webpack-jest-and-vscode-74007ce4adc9
I have setup jsconfig.json
in following manner and it works
{ "compilerOptions": { "paths": { "@/*": [ "src/*" ] } }}
I could get the eslint to not complain about it by:
install eslint-import-resolver-webpack (dev dependency)
add a webpack.config.js in the root of my project with the content:
const path = require('path'); // eslint-disable-line import/no-extraneous-dependencies
module.exports = {resolve: {alias: {'@': path.resolve(__dirname, 'src'),},extensions: ['.js', '.vue'],},};
in .eslintrs.js:
rules: {'import/extensions': ['error','always',{js: 'never',vue: 'never',},],},settings: {'import/resolver': {webpack: {config: 'webpack.config.js',},},},
I still would like to have the Intellisense working, but for now I will continue just doing that. Already lost more time than I should in this problem.