Vue3 keeps reporting errors error: Parsing error: Unexpected token

created at 10-17-2021 views: 67

After searching for a long time, I found that the online solutions didn’t work very well. After trying for two days, I finally solved the bug. This solution is only for vue3. After all, I didn’t encounter this bug with vue2, so I don’t know if it works.

Prerequisites

Confirm that the eslint-plugin-vue dependency has been installed

eslint-plugin-vue

Vue3+JS solution

Add the following configuration in the .eslint.js configuration file

Vue3+JS solution

Vue3+TS solution

Vue3+TS solution

Okay, these are the vue3 error reporting solutions I have compiled. Collect if you like!

created at:10-17-2021
edited at: 10-17-2021: