'@vue/airbnb',
'@vue/typescript',
],
rules: {
'no-undef': 0, // 由于eslint无法识别...// utils/index.js
function test(a, ...rest) {
console.log('hello', ...rest);
}
test(1, 2, 3, 4);
vscode...的eslint插件
除了eslint-webpack-plugin的插件帮我们在代码运行时就可以检测出代码的一些不规范问题,我们通常可以结合vscode插件帮我更友好的提示,我们需要在写代码的时候,编辑器就已经给我们提示错误...安装完后,打开对应文件,就会有对应的提示
并且你可以通过提示跳转到对应的eslint
.prettierrc自动格式化代码
在vscode中装上插件Prettier code formatter...我们也需要设置一下vscode的settings.json,主要设置参照如下
然后添加一行自动保存功能,这样我们就可以保存时,自动格式化自己的代码
{
"editor.codeActionsOnSave