Error while loading rule 'vuetify/no-deprecated-classes': context.parserServices.defineTemplateBodyVisitor is not a function
andersaa opened this issue · comments
Hi guys
I have followed the install guide on a newly created project on Vuetify to. I have many different things but no matter what I do I get the following error:
~/Development/myrepos/newproject/src/main/newfrontend $ npm run lint
ERROR TypeError: Error while loading rule 'vuetify/no-deprecated-classes': context.parserServices.defineTemplateBodyVisitor is not a function
Occurred while linting /Users/and/Development/myrepos/newproject/src/main/newfrontend/.eslintrc.js
TypeError: Error while loading rule 'vuetify/no-deprecated-classes': context.parserServices.defineTemplateBodyVisitor is not a function
Occurred while linting /Users/and/Development/myrepos/newproject/src/main/newfrontend/.eslintrc.js
at Object.create (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint-plugin-vuetify/lib/rules/no-deprecated-classes.js:52:35)
at createRuleListeners (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:746:21)
at /Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:916:31
at Array.forEach (<anonymous>)
at runRules (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:861:34)
at Linter._verifyWithoutProcessors (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:1157:31)
at Linter._verifyWithConfigArray (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:1255:21)
at Linter.verify (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:1210:25)
at Linter.verifyAndFix (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/linter/linter.js:1400:29)
at verifyText (/Users/and/Development/myrepos/newproject/src/main/newfrontend/node_modules/eslint/lib/cli-engine/cli-engine.js:230:48)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! newfrontend@0.1.0 lint: `vue-cli-service lint`
npm ERR! Exit status 1`
I am using Vuetify version 2.2.11. Here are some other version details from package.json:
"devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-service": "~4.2.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.1.2",
"eslint-plugin-vuetify": "^1.0.0-beta.6",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"vue-cli-plugin-moment": "~0.1.1",
"vue-cli-plugin-vuetify": "~2.0.5",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.3.0"
}
Not sure what kind of info to provide, please tell me if I should add anything.
Does anybody have any suggestions on how to fix this?
Thanks!
Kind regards,
Anders
I have a similar configuration with the following .eslintrs.js file. and facing the same issue.
// .eslintrc.js
module.exports = {
plugins: [
'vuetify'
],
rules: {
'vuetify/no-deprecated-classes': 'error',
'vuetify/grid-unknown-attributes': 'error',
'vuetify/no-legacy-grid': 'error',
}
}
I might be missing something as I have never used eslint before.
This eslint plugin is really only useful if you're in the process of upgrading from vuetify 1.5 to 2.x.
If you have a newly created 2.x project my recommendation would be to not use this plugin.
The instructions assume you're already using eslint-plugin-vue as well. If you aren't then the minimal config should have extends: ['plugin:vue/base']
too.