tb-format
产出符合icode规范的js和css代码
安装
$ npm i tb-format
使用
cli
$ tbformat
--fix
自动修复
API
由于js lint使用的是esLint
,vue和css lint使用的是prettier
,所以API有点差异(prettier
仅会进行ast解析并产出正确代码,不会去验证lint之前的code是否有lint规范错误问题)
const lint = /** * @param * @param * @return */lint /** * @param * @param * @return */lint /** * @param * @param * @return */lint
ignore
可以在pacakge.json
中配置ignore的文件或者路径,配置如下,版本差异: 2.x 版本 tbformat 为RegExp, 3.x版本优化为glob:
"tbformat": ".postcssrc.js" "coverage/" // 本项目只想做开箱即用性质的,主要对接icode style 所以不想加过多配置项