File tree Expand file tree Collapse file tree 4 files changed +23
-23
lines changed
Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 33## 安装
44
55``` bash
6- npm i @codegenius/clear-plugin
6+ npm i @codegenius/clear-plugin -D
77```
88
99``` javascript
10- // 开发期间使用
1110import { defineConfig } from " code-genius" ;
12- import clearInstaller from " @codegenius/clear-plugin" ;
11+ import { clearInstaller } from " @codegenius/clear-plugin" ;
1312
1413export default defineConfig ({
1514 plugins: [
1615 clearInstaller ({
17- files: [" ./src " ],
16+ files: [" ./dist " , " ./node_modules " ],
1817 }),
1918 ],
2019});
@@ -56,24 +55,9 @@ codeg clear --ask
5655### API 模式
5756
5857``` typescript
59- import { clear } from " code-genius " ;
58+ import { clear } from " @codegenius/clear-plugin " ;
6059
6160(async () => {
6261 await clear ([" ./dist" ]);
6362})();
64- ```
65-
66- ### 配置文件
67-
68- ``` typescript
69- # 覆盖默认的 ` files ` 配置
70- import { defineConfig } from " code-genius" ;
71-
72- export default defineConfig ({
73- commands: {
74- clear: {
75- files: [" ./dist" ]
76- },
77- },
78- });
79- ```
63+ ```
Original file line number Diff line number Diff line change 5858 "simple-git-hooks" : " ^2.9.0"
5959 },
6060 "simple-git-hooks" : {
61- "pre-commit" : " codeg format && codeg impsort -p src"
61+ "pre-commit" : " npx esno scripts/lint-script.ts" ,
62+ "commit-msg" : " codeg verify"
6263 }
6364}
Original file line number Diff line number Diff line change 1+ import { eslintFix } from "code-genius" ;
2+ import { impSort } from "code-genius" ;
3+ import { checkGitUserEmail } from "code-genius" ;
4+ import { prettierFormat } from "code-genius" ;
5+ import { execCommand } from "code-genius" ;
6+
7+ async function lint ( ) {
8+ await checkGitUserEmail ( "^[a-zA-Z0-9._%+-]+@(gmail)\\.(com)$" ) ;
9+ await prettierFormat ( [ "./src/" , "./scripts/" ] ) ;
10+ await eslintFix ( [ "./src/" , "./scripts/" ] ) ;
11+ await impSort ( [ "./src/" , "./scripts/" ] ) ;
12+ await execCommand ( "git" , [ "add" , "." ] ) ;
13+ }
14+
15+ lint ( ) ;
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ async function prepare() {
44 gitInitSimpleHooks ( ) ;
55}
66
7- prepare ( ) ;
7+ prepare ( ) ;
You can’t perform that action at this time.
0 commit comments