报错信息:error: Parsing error: Decorators cannot be used to decorate object literal properties
解决办法:
在.eslintrc.js文件加入legacyDecorators: true
就可以支持装饰器的写法了
parserOptions: {
// 解析器
parser: 'babel-eslint',
ecmaFeatures:{
// 支持装饰器
legacyDecorators: true
}
},
修改完文件如果还是报错,就在项目目录下npm install
下,再运行下就好了