-
Notifications
You must be signed in to change notification settings - Fork 4k
代码风格及Commit规范
整体代码风格符合 Angular Style Guide,并借助 prettier 和 tslint 及 tsconfig 进行代码风格检查和自动格式化。
项目 prettier 配置文件: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/.prettierrc
配置内容对照: https://prettier.io/docs/en/configuration.html
项目 tslint 配置文件: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/tslint.json
配置内容对照: https://palantir.github.io/tslint/rules/
附加 lint 内容:
项目 tsconfig 配置文件: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/tsconfig.json
-
webstorm 中可以依靠 filewatcher 增加 prettier 与 tslint --fix 规则,并且依赖 Save Actions 插件增加 Optimize imports 功能。
-
vscode 中可以依靠 prettier-vscode 实现相似功能。
commit 时使用 husky 在 pre-commit 时调用了 prettier 以及 tslint 对提交缓存区代码进行了自动 format 和 fix
在 travis 运行 ci 时,会运行 npm run lint 进行代码风格检查。
项目使用 Angular Commit Message Guidelines 标准规范,所有的 commit 均包含 header、body 和 footer 三个部分
commit 时使用 husky 和 commitlint 对 commit log 进行规范检查。
NG-ZORRO Team with ❤️