File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
# CodeGuide
2
- Alloyteam代码规范
2
+ ## AlloyTeam代码规范
3
+
4
+ ### 1. 为什么要有团队代码规范?
5
+ 虽然这些细节是小事,不会有体验或者性能上的优化,但是却体现了一个coder和团队的专业程度
6
+ 团队的愿景:成为业界卓越的Web团队!
7
+ 所以不管团队有多少人,代码风格都应该师出同门!
8
+
9
+ ### 2. 如何使用?
10
+ 在使用之前花一点时间把[ 规范] ( http://alloyteam.github.io/CodeGuide/ ) 看一遍是很必要的,
11
+ 然后按照[ 这里] ( http://alloyteam.github.io/CodeGuide/#check ) 的步骤配置好编辑器和构建检查(目前仅提供了sublime3和grunt的配置)
12
+
13
+ 主要使用到了jscs,jshint,sass-lint,csslint 四个规范检查插件,
14
+ JsFormat(它其实用的是jsbeautifier),CSScomb两个格式化的插件,
15
+ 使用其他编辑器的话可以自己去搜一下相关的这些插件。
16
+
17
+ 配置好后,保存的时候可以看到不合规范的代码行前面有明显的提示:
18
+ ![ ] ( http://alloyteam.github.io/CodeGuide/images/demo_1.png )
19
+
20
+ 将光标移到该行,可以在状态栏中看到详细的错误信息:
21
+ ![ ] ( http://alloyteam.github.io/CodeGuide/images/demo_2.png )
22
+
23
+ 建议在修改这些错误之前,js文件用JsFormat格式化一下(ctrl+alt+f),css文件用CSScomb格式化一下(ctrl+shift+c),可以减少很多工作量。
24
+
25
+ ### 3. 觉得不合理或者有遗漏的地方?
26
+ 如果觉得有不合理或者遗漏的地方,请访问[ 这里] ( https://github.com/AlloyTeam/CodeGuide/issues/new ) !
27
+
You can’t perform that action at this time.
0 commit comments