I have a vue project that build successfully, but when I add in the eslint option in package.json file I receive Parsing error: Unexpected token pointing at a private variable. I have been researching for the last few hours and have been unsuccessful at finding a solution that works.
sites I have visited, and solutions tried
https://stackoverflow.com/a/49129502/4250126
https://github.com/vuejs/eslint-plugin-vue/issues/746
https://stackoverflow.com/a/53609667/4250126
https://dev.to/ferasdawod/setting-up-eslint-for-a-vuejs-project-using-vs-code-i54
and some others...
I just can't seem to figure out why lint is complaining about a variable.
screen shot of running vue-cli-service lint from package.json. below I have tried changing public to private or removing the underscore, but it does not seem to help
my package.json
{
"name": "data-dictionary",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"description": "DataDictionary",
"author": {
"name": ""
},
"dependencies": {
"@typescript-eslint/parser": "^2.4.0",
"axios": "^0.19.0",
"bootstrap-vue": "^2.0.4",
"buefy": "^0.8.5",
"eslint-plugin-import": "^2.18.2",
"vue": "2.5.17",
"vue-property-decorator": "^8.2.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "3.0.4",
"@vue/cli-plugin-eslint": "3.0.4",
"@vue/cli-plugin-typescript": "^3.12.0",
"@vue/cli-service": "3.0.4",
"babel-eslint": "^10.0.3",
"eslint": "5.6.0",
"eslint-plugin-vue": "^4.7.1",
"typescript": "^3.6.4",
"vue-template-compiler": "2.5.17"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:import/typescript",
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
},
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module",
"ecmaFeatures": {
"legacyDecorators": true
},
"ecmaVersion": 6
}
},
"eslintIgnore": [ "/**/*.d.ts" ],
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
Any help is appreciated. I am probably doing something completely wrong, but not extremely familiar with using lint with Vue.
UPDATE If I remove the public/private keywords then vue-cli-service lint passes.