在使用vueCli的脚手架工具创建完项目后,然后倒入模块的时候出现了error 'XXX' is defined but never used这样的错误,这是由于我们使用了eslint规范,ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误。这就导致了运行时候出现的错误。解决办法:

在package.json文件内加入如下代码:然后保存重启项目。

"rules": {
    "generator-star-spacing": "off",
    "no-tabs":"off",
    "no-unused-vars":"off",
    "no-console":"off",
    "no-irregular-whitespace":"off",
    "no-debugger": "off"
},
Last modification:March 13, 2021
If you think my article is useful to you, please feel free to appreciate