css - 统一管理前端代码
PHP中文网
PHP中文网 2017-04-17 12:59:25
0
10
577

1、公司现在分为前端和后台,后台和前端定义好接口进行数据交互;
2、后台代码(主要是java)的书写格式、注释有一套严格的规范,每次提交代码都会进行构建(如checkstyle)来验证后台代码的格式、注释、换行、缩进是否规范;
3、后台代码有一台管理工具,可是前端目前没有;
4、忘网友能提供代码格式、注释规范的管理办法,来公司控制每个人书写的代码。

PHP中文网
PHP中文网

认证0级讲师

reply all(10)
Ty80

It is better to use grunt

Peter_Zhu

I happened to see a HTML and CSS specification from NetEase http://nec.netease.com/standard, you can refer to it.

伊谢尔伦

JavaScript Code Style
Airbnb’s public code style

There is also bootstrap.

Ty80

There are still some similar tools, front-end scaffolding. Like gulp, grunt, fis, webpack, browserify, THX and many more. See official documentation.

巴扎黑

Code Format Specification jshint

黄舟

eshint syntax check

Ty80

Eslint + Webpack, it’s all up to your standards

黄舟

I think unified management code has two meanings:

1. Manage all codes in one place, such as code management through code management tools such as git, svn, vss, etc., and control the quality and process of the code through management tools;

2. Unify code writing standards, comment standards, styles, etc. This aspect involves different aspects. Because in the previous paragraph, we generally think that there are three aspects that need to be standardized: the first is HTML writing specifications and nesting rules, the second is CSS, and the third is JavaScript.

I don’t know what point the questioner wants to ask about above?

巴扎黑

We use jscs and eslint to perform static checks together. Both of them can even be automatically repaired by adding the --fix parameter.
For example, it was originally stipulated that semicolons were required, but later the stipulation was changed that no semicolons were required. Just change the jscs configuration and run the following command, and all files will be ready.

jscs --fix .
迷茫

Uglify the application environment and Beautify the production environment. However, Beautify is just an intermediate process. Commonly used ones are: Gulp, Grunt, NPM + Webpack; involving inspection, compilation, merging and compression;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template