學習小程序編寫第二天了,今天是使用wepy框架寫小程序的第一天。在原生小程序中寫好的代碼用wpy寫一遍發現很多錯誤,【一臉懵逼】。下面看看遇到的報錯:
97:29 error A space is required after ',' comma-spacing
114:18 error Strings must use singlequote quotes
170:23 error Extra semicolon semi
172:18 error Infix operators must be spaced space-infix-ops
173:46 error Missing space before opening brace space-before-blocks
190:20 error Block must not be padded by blank lines padded-blocks
191:1 error Trailing spaces not allowed no-trailing-spaces
197:10 error Newline required at end of file but not found eol-last
基本上翻譯一下就能知道是什麼問題了。
1、逗號後面要加空格
2、不能使用雙引號,要使用單引號。
3、不能使用分號;這是我覺得最坑爹的地方
4、運算符前後要有空格(Java有這樣的規範,但不強制)
5、開括號前要有空格“ { ”
6、代碼塊裏不能有空行
7、代碼結尾不能帶空格(很難發現,煩)
8、文件結尾需要換行
暫時發現這麼多坑,歡迎補充、指正