eslint-plugin-vue: Parsing error: Unexpected token <
Tell us about your environment
- ESLint Version: v5.11.1
- Node Version: v10.14.2
- npm Version: 6.4.1
What parser (default, Babel-ESLint, etc.) are you using?
- .eslintrc.js
Please show your full configuration:
Configuration
module.exports = {
root: true,
parserOptions: {
"parser": "babel-eslint",
"sourceType": "module",
"ecmaVersion": 6
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ["eslint:recommended"],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-undef": "off",
"no-unused-vars": "off",
"no-redeclare": "off",
"no-empty": "off",
"indent": ["warn", 4],
'vue/max-attributes-per-line': 'off',
'vue/order-in-components': 'off',
'vue/html-end-tags': 'off',
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
vue code
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App'
};
</script>
run ESLint :
eslint --fix "./src/**/*.{js,vue}"
What did you expect to happen?
good running
What actually happened? Please include the actual, raw output from ESLint.
D:\_Me\-COMPANY-JiTeng-\src\App.vue :
1:1 error Parsing error: Unexpected token <
Are you willing to submit a pull request to fix this bug?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (3 by maintainers)
You can use the following settings.
"extends": ["plugin:vue/base"]
https://eslint.vuejs.org/user-guide/#faq
Hi @PLQin! Please take a look at the installation instruction https://eslint.vuejs.org/user-guide/#installation You’re not extending configuration that this plugin provides.
Nice, have good, through the set to
"extends" : [" plugin: vue/base "]
solved my problem ;thank you !~ 👍
Thanks! it works like charm!
Thank you <3000