vue使用eslint遇到的坑

2021-10-03 14:44:42 字數 543 閱讀 3682

一、 error  extra semicolon  semi

解決:eslint 配置是以 standard 為基礎的,要求是不使用分號,要使用分號則需要在.eslintrc配置檔案rules增加配置:

『semi』:['error','always'],

如果希望eslint不檢查分號,就『semi』:0,

二、indent expected indentation of 2 spaces but found 4

解決:縮排錯誤,.eslintrc配置檔案設定縮排為4,

"indent": ["error",4],
三、data屬性應位於template之上:warning the "data" property should be above the "template" property on line 5 

四、後面多了乙個句號:error unexpected trailing comma 

五、檔案末尾需要換行:error newline required at end of file but not found

Vue使用ESLint踩過的坑

1 missing space before value for key methods methods的值之前要有空格2 missing space before opening brace 開始的 大括號之前缺少空格3 missing space before function parenthe...

vue使用mui遇到的坑

主要用到webpack打包工具與mui,mint ui,其中mui有不少坑,在此記錄 mounted 注意,一定要在mounted鉤子函式中使用。還有個小問題,vue的滾動事件問題,若父容器設定了overflow hidden,使用onscroll繫結事件會無效,若不想改變父容器overflow屬性...

vue專案Eslint工具的使用

1 安裝 eslint 7.5.0 eslint config standard 14.1.1 eslint friendly formatter 4.0.1 eslint loader 4.0.2 eslint plugin import 2.22.0 eslint plugin node 11....