Skip to content

Commit

Permalink
feat(projects): add eslint-prettier and lint-staged command
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed May 31, 2023
1 parent 53f2f21 commit 2733099
Show file tree
Hide file tree
Showing 14 changed files with 254 additions and 137 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ pnpm soy -h

## 命令介绍

| 命令 | 作用 |
| ----------------- | --------------------------------------------- |
| help | 查看全部命令用法 |
| git-commit | 生成符合 Angular 规范的 git 提交信息 |
| git-commit-verify | 校验 git 的提交信息是否符合 Angular 规范 |
| cleanup | 清空依赖和构建产物 |
| cleanup-deep | 清空依赖和构建产物(包含 深层级) |
| init-git-hooks | 初始化 simple-gi t-hooks 钩子 |
| update-pkg | 升级依赖 |
| prettier-format | prettier 格式化 |
| 命令 | 作用 |
| ----------------- | ---------------------------------------- |
| help | 查看全部命令用法 |
| git-commit | 生成符合 Angular 规范的 git 提交信息 |
| git-commit-verify | 校验 git 的提交信息是否符合 Angular 规范 |
| cleanup | 清空依赖和构建产物 |
| cleanup-deep | 清空依赖和构建产物(包含 深层级) |
| init-git-hooks | 初始化 simple-gi t-hooks 钩子 |
| update-pkg | 升级依赖 |
| prettier-format | prettier 格式化 |

### prettier-format

Expand Down
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: ['src/index'],
entries: ['src/index', 'src/lint-staged.config'],
clean: true,
rollup: {
emitCJS: true,
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"exports": {
"./lint-staged": {
"import": "./dist/lint-staged.config.mjs",
"require": "./dist/lint-staged.config.cjs"
}
},
"bin": {
"soybean": "dist/index.mjs",
"soy": "dist/index.mjs"
Expand All @@ -42,6 +48,7 @@
"enquirer": "2.3.6",
"execa": "7.1.1",
"kolorist": "1.8.0",
"lint-staged": "13.2.2",
"minimist": "1.2.8",
"npm-check-updates": "16.10.12",
"rimraf": "5.0.1"
Expand All @@ -52,18 +59,13 @@
"bumpp": "9.1.0",
"eslint": "8.41.0",
"eslint-config-soybeanjs": "0.4.7",
"lint-staged": "13.2.2",
"simple-git-hooks": "2.8.1",
"tsx": "3.12.7",
"typescript": "5.0.4",
"unbuild": "1.2.1"
},
"simple-git-hooks": {
"commit-msg": "pnpm soy git-commit-verify",
"pre-commit": "pnpm typecheck && pnpm lint-staged"
},
"lint-staged": {
"*.{js,mjs,jsx,ts,mts,tsx,json,vue,svelte,astro}": "eslint . --fix",
"*.!{js,mjs,jsx,ts,mts,tsx,json,vue,svelte,astro}": "format"
"pre-commit": "pnpm typecheck && pnpm soy lint-staged"
}
}
Loading

0 comments on commit 2733099

Please sign in to comment.