【发布时间】:2019-07-16 08:39:04
【问题描述】:
大家好,我遇到了 vue-eslint-parser 的问题。我正在尝试在 Encore 上运行它
/var/app/assets/js/app.js 1:1 错误使用最新的 vue-eslint-parser。另见https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-errorvue/valid-v-pre 1:1 错误使用最新的 vue-eslint-parser。另见https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-errorvue/no-duplicate-attributes 1:1 错误使用最新的 vue-eslint-parser。另见https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-errorvue/no-textarea-mustache
无法弄清楚发生了什么,错误中的链接无济于事 我在 docker 容器中运行 yarn
docker-compose.yaml 文件
yarn:
image: node:10
command: yarn run install_watch
working_dir: /var/app
volumes:
- .:/var/app/:cached
environment:
NPM_TOKEN: "${NPM_TOKEN}"
webpack.config.js
var Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/js/app.js')
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableEslintLoader()
.enableSassLoader()
.enableVueLoader()
;
module.exports = Encore.getWebpackConfig();
package.json
{
"devDependencies": {
"@symfony/webpack-encore": "^0.22.0",
"@vue/cli-plugin-eslint": "^3.4.1",
"babel-eslint": "^8.2.1",
"eslint-loader": "^1.9.0",
"node-sass": "^4.11.0",
"sass-loader": "^7.0.1",
"vue": "^2.6.6",
"vuex": "^3.1.0",
"vue-loader": "^15.0.11",
"vue-router": "^3.0.2",
"vue-template-compiler": "^2.6.6",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress",
"install_prod": "yarn install && yarn run build",
"install_watch": "yarn install && yarn run watch"
}
}
.eslintrc.json
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:vue/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
}
}
【问题讨论】:
标签: symfony vue.js webpack eslint webpack-encore