tp-eslint-tool
v1.0.5
Published
eslint规范化工具
Downloads
10
Readme
tp-eslint-tool
项目接入 eslint 规范工具包
何时使用
项目接入 eslint 规范使用,非 v6 项目也可使用
使用
初始化
根据 eslint 规范对项目进行自动化配置(已包含下面几个命令的功能)
sudo npx tp-eslint-tool init
请注意:
- 如果项目的
package.json
中原来有eslint相关配置,请删除,以免和新规则冲突 - 如果项目代码不是统一放在
src
目录下,命令执行成功后,请修改.lintstagedrc.js
中src/**/*
为项目代码所在目录,如./**/*
- 添加git hook拦截后,
git commit -m '备注的信息'
的备注信息需要符合.commitlintrc.js
中指定的类型:如feat: 备注的信息
(注意,:
需要是英文冒号,且冒号后面必须有空格)
添加 git 拦截
添加 git hooks,依赖 husky、lint-staged
sudo npx tp-eslint-tool git
自动修复 eslint 问题
自动修复可修复的 eslint 问题
sudo npx tp-eslint-tool fix
更新
有规则更新时执行
sudo npx tp-eslint-tool update
配置vscode
配置vscode及安装相关插件
sudo npx tp-eslint-tool vscode
帮助
查看所有命令说明
sudo npx tp-eslint-tool help