学习小程序编写第二天了,今天是使用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、文件结尾需要换行
暂时发现这么多坑,欢迎补充、指正