Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 lint 配置以及相应模板 #80

Merged
merged 11 commits into from Mar 25, 2017
Merged

添加 lint 配置以及相应模板 #80

merged 11 commits into from Mar 25, 2017

Conversation

dolymood
Copy link
Contributor

现在模板分为两种:

  • 默认正常版本 带分号+4个空格的
  • 创建项目的时候增加 --standard 参数,有的话创建的项目就是 不带分号+两个空格

创建项目的时候,默认会增加 eslint 和 editorconfig 配置,如果不想要的话可以在创建项目的时候增加 --no-lint

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.855% when pulling cb86767 on dolymood:master into 9a66435 on wepyjs:master.

@Gcaufy
Copy link
Collaborator

Gcaufy commented Mar 25, 2017

感谢eslint的PR,这个也是一直想做但没时间做的。
看了一下代码,不过似乎standardnormal目录的代码有些冗余。

@dolymood
Copy link
Contributor Author

是的,理论上的效果,应该是把模板部分拆成单独的项目,或者就算不是拆成单独的项目也是可以有很多共用的部分。

不管是不是单独的,但是总归结果是要把共用的部分拆分出来,这个地方还没有想好一个比较相对优雅的方式来做替换,毕竟涉及到 4空格到2空格,分号替换等。

考虑到两个模板毕竟“不大”,所以做了妥协处理;当然如果有更好一点的做法就更好了。

PS:有一个想法是建单独项目,实时下载然后作为模板内容。

@Gcaufy
Copy link
Collaborator

Gcaufy commented Mar 25, 2017

修改了一下,只保留了一份template。否则以后要维护两份。

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.855% when pulling 00af027 on dolymood:master into 9a66435 on wepyjs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.855% when pulling 645a026 on dolymood:master into 9a66435 on wepyjs:master.

@dolymood
Copy link
Contributor Author

👍

@Gcaufy Gcaufy merged commit 645a026 into Tencent:master Mar 25, 2017
@Gcaufy Gcaufy deployed to github-pages March 25, 2017 12:43 Active
@neurotoxinvx
Copy link

wepy new yourproject 时无需添加 --standard 参数,默认创建的项目即为遵守 2空格、无分号 的代码规范

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants