VueJS is impossible to set up #14106
-
|
Hey guys, i have been working a lot with Next.js but occasionally have projects that need to be in Vue. Everytime i use Vue.js, i skip using Eslint and Prettier or accept that most files are marked as "red" because of error messages that are in fact no errors in Vue. I would want to ask, if there is any guideline or tutorial on how to properly set up Vue.js with the regular tech-stack (Typescript, Eslint, Prettier) or if it is just not supported. I have been trying to set it up every now and again for a long time now and was never successful. So far i have tried the following:
Either way, i end up with:
I have the following VS Code extensions for Vue:
I have absolutely no struggles setting up the entire tech-stack in any other environment. Since Vue is used by many people, i am really really curious how other people are actually using it, because for me it does not work the way i would expect it to. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
Have you read this: https://code.visualstudio.com/docs/nodejs/vuejs-tutorial? Did that help? |
Beta Was this translation helpful? Give feedback.
-
|
Official recent bug with version 3.1.4 |
Beta Was this translation helpful? Give feedback.
-
|
i had same frustration before. the problem is extension conflicts. fix:
so you should only have ONE extension: Vue - Official for eslint/prettier: use the new @vue/eslint-config-prettier: npm create vue@latest my-app
# select yes for typescript, eslint, prettierthis sets up everything correctly. the cli now uses flat eslint config. your eslint.config.js should look like: import pluginVue from "eslint-plugin-vue"
import vueTsEslintConfig from "@vue/eslint-config-typescript"
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting"
export default [
...pluginVue.configs["flat/recommended"],
...vueTsEslintConfig(),
skipFormatting,
]in vscode settings.json: {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}the key is removing vetur and old volar. vue ecosystem changed a lot recently |
Beta Was this translation helpful? Give feedback.
i had same frustration before. the problem is extension conflicts.
fix:
so you should only have ONE extension: Vue - Official
for eslint/prettier:
use the new @vue/eslint-config-prettier:
npm create vue@latest my-app # select yes for typescript, eslint, prettierthis sets up everything correctly. the cli now uses flat eslint config.
your eslint.config.js should look like: