-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template root requires exactly one element #1297
Comments
Please use eslint-plugin-vue@7.0.0-beta.3. |
why latest vue cli not work, it includes @vue/cli 4.5.7 "dependencies": {
"vue": "^3.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0",
"typescript": "~3.9.3"
}
}
|
I found the reason about it. I have several small projects under one directory say so I have If I open I guess we cannot nest our projects in vs code otherwise this plugin will not work. |
Still getting template root requires exactly one element with eslint-plugin-vue@7.0.0-beta.3. |
Getting this same error on a vue 3.0.2 project, using eslint-plugin-vue@^7.1.0 |
Exactly!! Same here @ota-meshi Please help |
Getting:
Version check:
Issue still exists it seems. I am busy checking if it's maybe the airbnb config:
Temporary work-around for now is changing your .eslintrc.json file to:
The rules piece. |
Getting the same error adding
|
In my case the problem was that I was working in a VS Code workspace. Because of the workspace Vetur thinks that it is a Vue 2 project. I just disabeled the Vetur linting in the VS Code settings and the error is no longer there |
vscode-> plugins-> close Vetur and restart vscode, and open Vetur again. P.S. make sure your vscode plugin Vetur version is lastest. |
As @uniquejava said, you have to open Visual Studio Code with that directory only, if you are workin with another folders in the same workspace, the error occurs although you have configured your eslintrc very well. |
A quick fix for me was to just go to Extensions in VS Code -> Vetur settings -> and uncheck the "Vetur>Validation:Template" option . |
Thanks @uniquejava, It works! |
I met the same issue when using vue@3. Did someone have solved it? Do not tell me to uncheck the vetur settings. |
I created a new Vue3 project, installed vetur for vscode and get the same issue. Added |
@Syverpet Thank you very much! I took a long time to find your answer. Thank you! |
@Syverpet j'ai essayé ta solution mais rien a faire pour moi je suis tjrs bloqué avec le même problème quelqu'un peut m'aider svp |
I have migrated a big production-ready website from Vue 2 to Vue 3 and, I am also getting this error from eslint.
|
For Vue 3, please disable the FYI: For Vue 3, the recommended VS Code extension changed from Vetur to Volar, see https://v3-migration.vuejs.org/recommendations.html#ide-support. I'm now going to lock the discussion to prevent further comments. Please open new issues using the issue template and link to this issue if there are more questions. |
What rule do you want to change?
In release 3, the following code produces a linting error but should not.
template now acts as the root element and using div is no longer required.
The text was updated successfully, but these errors were encountered: